Class: Utm

utm~Utm

UTM coordinates, with functions to parse them and convert them to LatLon points.

Constructor

new Utm(zone, hemisphere, easting, northing, datumopt, convergenceopt, scaleopt)

Creates a Utm coordinate object.
Parameters:
Name Type Attributes Default Description
zone number UTM 6° longitudinal zone (1..60 covering 180°W..180°E).
hemisphere string N for northern hemisphere, S for southern hemisphere.
easting number Easting in metres from false easting (-500km from central meridian).
northing number Northing in metres from equator (N) or from false northing -10,000km (S).
datum LatLon.datums <optional>
WGS84 Datum UTM coordinate is based on.
convergence number <optional>
Meridian convergence (bearing of grid north clockwise from true north), in degrees
scale number <optional>
Grid scale factor
Source:

Methods

(static) parse(utmCoord, datumopt) → {Utm}

Parses string representation of UTM coordinate. A UTM coordinate comprises (space-separated) - zone - hemisphere - easting - northing.
Parameters:
Name Type Attributes Default Description
utmCoord string UTM coordinate (WGS 84).
datum Datum <optional>
WGS84 Datum coordinate is defined in (default WGS 84).
Source:
Throws:
Error Invalid UTM coordinate
Returns:
Type
Utm
Example
var utmCoord = Utm.parse('31 N 448251 5411932');
  // utmCoord: {zone: 31, hemisphere: 'N', easting: 448251, northing: 5411932 }

toLatLon(utmCoord) → {LatLon}

Converts UTM zone/easting/northing coordinate to latitude/longitude
Parameters:
Name Type Description
utmCoord Utm UTM coordinate to be converted to latitude/longitude.
Source:
Returns:
Latitude/longitude of supplied grid reference.
Type
LatLon
Example
var grid = new Utm(31, 'N', 448251.795, 5411932.678);
  var latlong = grid.toLatLon(); // 48°51′29.52″N, 002°17′40.20″E

toString(digitsopt) → {string}

Returns a string representation of a UTM coordinate. To distinguish from MGRS grid zone designators, a space is left between the zone and the hemisphere.
Parameters:
Name Type Attributes Default Description
digits number <optional>
0 Number of digits to appear after the decimal point (3 ≡ mm).
Source:
Returns:
A string representation of the coordinate.
Type
string