Coordinates
Class: Coordinates
A Coordinates position using at least latitude (lat) and longitude (lng). Optionnal fields are: altitude (alt) and level.
Basic geo methods are directly accessibles from here: distanceTo, bearingTo, toEcef...
Coordinates are WGS84 and every transformation here uses the ellipsoid, so the local up
axis is the ellipsoid normal and the ECEF / ENU geometry reads alt as a height above the
ellipsoid.
What alt actually carries is not settled across the SDK, and that predates this class:
the position providers put a height above the ground in it (Constants.DEFAULT_ALTITUDE is
1.6m, a phone in a hand), while GeoRef.localToWorld compares it against the absolute
floorAltitude / ceilingAltitude of a building level. Both cannot be right. Only differences
matter to the geometry here, which is why the ambiguity has never surfaced as a bug, but
level detection does depend on the answer.
(Until 2026-08 this class modelled the earth as a sphere of radius R_MAJOR for speed. That cost ~0.35% of anisotropic scale error at mid-latitude and tilted the local vertical by 11.5', i.e. ~33cm of altitude error per 100m of horizontal travel.)
Extended by
Constructors
Constructor
new Coordinates(
lat,lng,alt?,level?):Coordinates
Parameters
lat
number
lng
number
alt?
number | null
level?
Level_t = null
Returns
Coordinates
Properties
autoWrap
autoWrap:
boolean=true
Accessors
alt
Get Signature
get alt():
number|null
alt does not denote the altitude of a point but its height from the "level" field (if defined) or from the ground /!\ This is the providers' convention, not GeoRef's: see the class header.
Returns
number | null
Set Signature
set alt(
alt):void
Parameters
alt
number | null
Returns
void
ecef
Get Signature
get ecef():
Vector3_t
https://gist.github.com/klucar/1536194
Returns
Vector3_t
ecefToEnuRotation
Get Signature
get ecefToEnuRotation():
Quaternion_t
Returns
Quaternion_t
enuToEcefRotation
Get Signature
get enuToEcefRotation():
Quaternion_t
ECEF Transformations (WGS84 ellipsoid)
Returns
Quaternion_t
heightFromFloor
Get Signature
get heightFromFloor():
number|null
Returns
number | null
Set Signature
set heightFromFloor(
heightFromFloor):void
Parameters
heightFromFloor
number | null
Returns
void
heightFromGround
Get Signature
get heightFromGround():
number|null
Returns
number | null
Set Signature
set heightFromGround(
heightFromGround):void
Parameters
heightFromGround
number | null
Returns
void
lat
Get Signature
get lat():
number
Returns
number