Class: LatLonEllipsoidal

latlon-ellipsoidal~LatLonEllipsoidal

Latitude/longitude points on an ellipsoidal model earth, with ellipsoid parameters and methods for converting between datums and to cartesian (ECEF) coordinates.

Constructor

new LatLonEllipsoidal(lat, lon, heightopt, datumopt)

Creates lat/lon (polar) point with latitude & longitude values, on a specified datum.
Parameters:
Name Type Attributes Default Description
lat number Geodetic latitude in degrees.
lon number Longitude in degrees.
height number <optional>
0 Height above ellipsoid in metres.
datum LatLon.datums <optional>
WGS84 Datum this point is defined within.
Source:

Members

(static) datums

Datums; with associated ellipsoid and Helmert transform parameters to convert from WGS-84 into given datum.
Source:
Example
var a = LatLon.datums.OSGB36.ellipsoid.a; // 6377563.396
  var tx = LatLon.datums.OSGB36.transform;  // to WGS-84

(static) ellipsoids

Ellipsoid parameters; major axis (a), minor axis (b), and flattening (f) for each ellipsoid.
Source:
Example
var a = LatLon.ellipsoids.Airy1830.a; // 6377563.396

Methods

convertDatum(toDatum) → {LatLon}

Converts ‘this’ lat/lon coordinate to new coordinate system.
Parameters:
Name Type Description
toDatum LatLon.datums Datum this coordinate is to be converted to.
Source:
Returns:
This point converted to new datum.
Type
LatLon
Example
var pWGS84 = new LatLon(51.4778, -0.0016, 0, LatLon.datums.WGS84);
  var pOSGB = pWGS84.convertDatum(LatLon.datums.OSGB36); // 51.4773°N, 000.0000°E

toCartesian() → {Cartesian}

Converts ‘this’ point from (geodetic) latitude/longitude coordinates to (geocentric) cartesian (x/y/z) coordinates.
Source:
Returns:
Cartesian point equivalent to lat/lon point, with x, y, z in metres from earth centre.
Type
Cartesian

toString(formatopt, dpopt, heightDpopt) → {string}

Returns a string representation of ‘this’ point, formatted as degrees, degrees+minutes, or degrees+minutes+seconds.
Parameters:
Name Type Attributes Default Description
format string <optional>
dms Format point as 'd', 'dm', 'dms'.
dp number <optional>
0|2|4 Number of decimal places to use: default 0 for dms, 2 for dm, 4 for d.
heightDp number <optional>
null Number of decimal places to use for height; default is no height display.
Source:
Returns:
Comma-separated formatted latitude/longitude.
Type
string