Expand description
Point codes, both ways: geohash, Plus Code (Open Location Code), UTM, MGRS and degrees-minutes-seconds.
The answer can carry them (--with codes), and a query can be one of them (the coordinate reader of the
query path). No crate: each format is a published, short algorithm, and none of the crates reads a UTM
string with its zone. UTM uses the Krüger series to the sixth order (Karney 2011), good to well under a
millimetre inside a zone; MGRS is UTM with the 100 km square letters of the AA scheme (WGS84).
Structs§
- Utm
- One UTM coordinate: zone 1..=60, band letter (C..X without I and O), easting and northing in metres.
Functions§
- digipin_
decode - The centre of a DIGIPIN cell: ten symbols of the grid, any case, with or without the old hyphens or spaces.
- digipin_
encode - The DIGIPIN of a point, or
Noneoutside the box of the code (latitude 2.5–38.5, longitude 63.5–99.5). - dms_
format - “48°51’24.0“N 2°21’03.0“E” with one decimal of a second (~3 m).
- dms_
parse - A pair of angles with hemisphere letters: “48°51’24“N 2°21’03“E”, “48 51 24 N 2 21 3 E”, “N48°51.4’ E2°21.05’”. Both letters are required (a bare pair is decimal degrees, read elsewhere), and N/S must come with the latitude. “O” (oeste/ouest) counts as west.
- geohash_
decode - Centre of a geohash cell, or
Nonewhen a character is outside the alphabet. - geohash_
encode - Geohash of
lencharacters (1..=12). - haversine_
m - mgrs_
decode - Centre of an MGRS square (“31U DQ 48252 11954”, any precision from 10 km to 1 m; spaces allowed).
- mgrs_
encode - MGRS at 1 m (“31UDQ4825211954”);
Noneoutside the UTM bands. - plus_
code_ decode - Centre of a full Plus Code. A short code (fewer than 8 digits before “+”) needs a reference point and is refused, as is padding (“0”).
- plus_
code_ encode - Full Plus Code of 10 digits plus the 11th grid digit (“8FVC9G8F+6XQ” style has 11; 10 is ~14 m).
- utm_
decode - Latitude and longitude of a UTM coordinate.
southsays the northing counts from the false origin of the southern hemisphere (band letter below N). - utm_
encode - UTM of a point between 80°S and 84°N (outside, the polar UPS grid applies and
Noneis returned). - utm_
parse - “33U 448251 5411932” or “33N 448251 5411932” (hemisphere letter N/S, or a band letter).
- utm_
zone - The UTM zone of a point, with the Norway and Svalbard exceptions.