UNPKG

@itwin/core-common

Version:

iTwin.js components common to frontend and backend

138 lines 7.28 kB
/** @packageDocumentation * @module Geometry */ import { Angle, Point3d, Range2d, Range3d, Transform } from "@itwin/core-geometry"; /** The JSON representation of a Cartographic object. * @public * @extensions **/ export interface CartographicProps { /** The longitude, specified in radians. */ longitude: number; /** The latitude, specified in radians. */ latitude: number; /** The height, specified in meters above the ellipsoid. */ height: number; } /** A position on the earth defined by longitude, latitude, and height above the [WGS84](https://en.wikipedia.org/wiki/World_Geodetic_System) ellipsoid. * @public */ export declare class Cartographic implements CartographicProps { longitude: number; latitude: number; height: number; /** * @param longitude longitude, in radians. * @param latitude latitude, in radians. * @param height The height, in meters, above the ellipsoid. */ private constructor(); /** Create a Cartographic object with longitude, latitude, and height of zero. */ static createZero(): Cartographic; /** Create a new Cartographic from longitude and latitude specified in radians. * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are numbers specified in radians. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero. * @param result The object onto which to store the result. */ static fromRadians(args: { longitude: number; latitude: number; height?: number; }, result?: Cartographic): Cartographic; /** Create a JSON representation of a Cartographic object. */ toJSON(): CartographicProps; /** Freeze this Cartographic */ freeze(): Readonly<this>; /** longitude, in degrees */ get longitudeDegrees(): number; /** latitude, in degrees */ get latitudeDegrees(): number; private static _oneMinusF; private static _equatorOverPolar; /** return the geocentric latitude angle for the input geodetic latitude angle (both in radians). * @param geodeticLatitude geodetic latitude angle in radians */ static geocentricLatitudeFromGeodeticLatitude(geodeticLatitude: number): number; /** return the parametric latitude angle for the input geodetic latitude angle (both in radians). The parametric latitude * is appropriate for input to the Ellipsoid methods. * @param geodeticLatitude geodetic latitude angle in radians */ static parametricLatitudeFromGeodeticLatitude(geodeticLatitude: number): number; /** Create a new Cartographic from longitude and latitude specified in degrees. The values in the resulting object will be in radians. * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are numbers specified in degrees. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero. * @param result The object onto which to store the result. */ static fromDegrees(args: { longitude: number; latitude: number; height?: number; }, result?: Cartographic): Cartographic; /** Create a new Cartographic from longitude and latitude in [Angle]($geometry)s. The values in the resulting object will be in radians. * @param args an object containing a longitude, latitude, and an optional height property. The longitude and latitude properties are Angle objects. The height property, if specified, is a number which contains the height in meters above the ellipsoid; if undefined, this height will default to zero. * @param result The object into which to store the result (optional) */ static fromAngles(args: { longitude: Angle; latitude: Angle; height?: number; }, result?: Cartographic): Cartographic; private static _cartesianToCartographicN; private static _cartesianToCartographicP; private static _cartesianToCartographicH; private static _wgs84OneOverRadii; private static _wgs84OneOverRadiiSquared; private static _wgs84RadiiSquared; private static _wgs84CenterToleranceSquared; private static _scratchN; private static _scratchK; /** Creates a new Cartographic from an [ECEF](https://en.wikipedia.org/wiki/ECEF) position. * @param cartesian The position, in ECEF, to convert to cartographic representation. * @param [result] The object onto which to store the result. * @returns The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid. */ static fromEcef(cartesian: Point3d, result?: Cartographic): Cartographic | undefined; /** Scale point to geodetic surface * @param point in ECEF to scale to the surface * @param [result] The object onto which to store the result. * @returns a point on the geodetic surface */ static scalePointToGeodeticSurface(point: Point3d, result?: Point3d): Point3d | undefined; /** Duplicates a Cartographic. */ clone(result?: Cartographic): Cartographic; /** Return true if this Cartographic is the same as right */ equals(right: CartographicProps): boolean; /** Compares this Cartographic component-wise and returns true if they are within the provided epsilon, */ equalsEpsilon(right: CartographicProps, epsilon: number): boolean; private static normalize; private static multiplyComponents; private static scalePoint; private static addPoints; /** Create a string representing this cartographic in the format '(longitude, latitude, height)'. */ toString(): string; private static _scaleToGeodeticSurfaceIntersection; private static _scaleToGeodeticSurfaceGradient; private static _scaleToGeodeticSurface; /** Return an ECEF point from a Cartographic point */ toEcef(result?: Point3d): Point3d; } /** A cartographic range representing a rectangular region if low longitude/latitude > high then area crossing seam is indicated. * @public */ export declare class CartographicRange { private _ranges; private _minLongitude; private _maxLongitude; private _minLatitude; private _maxLatitude; constructor(spatialRange: Range3d, spatialToEcef: Transform); intersectsRange(other: CartographicRange): boolean; /** This method returns the raw latitude / longitude for the range in a Range2d object. * The X value represents the longitude and the Y value the latitudes. * Y values are kept between -PI and +PI while * longitude values can be expressed in any range between -2PI to +2PI * given the minimum longitude is always smaller numerically than the maximum longitude. * Note that usually the longitudes are usually by convention in the range of -PI to PI except * for ranges that overlap the -PI/+PI frontier in which case either representation is acceptable. */ getLongitudeLatitudeBoundingBox(): Range2d; } //# sourceMappingURL=Cartographic.d.ts.map