Skip to main content

formatUtm

Writes a position as a UTM reference: the zone, its band letter, the easting to the metre and the northing to the metre, for example "31U 500000 5500000". The band letter names the eight-degree latitude band (C at 80° S through X at 84° N), which names the hemisphere as well.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { formatUtm } from "@mapcairn/core";

function formatUtm(position: LatLng): string | null;

Parameters​

  • position (LatLng)

Returns​

string | null: The reference, or null when the position is not finite or is outside the UTM grid, which stops at 80° S and 84° N; those latitudes belong to the polar stereographic zones, which this does not write. A longitude outside −180 to 180 is wrapped first.

Remarks​

The UTM convention reads the letter after the zone as a hemisphere letter when it is N or S, so a band-S reference (32 to 40 degrees north) written with its band letter would not read back: it would name the southern hemisphere. For band S alone this writes the hemisphere letter N instead, which names the same hemisphere and reads back as the same position.

See also​

Source: packages/core/src/coordinates/utm.ts:309