Skip to main content

Module codes

Module codes 

Source
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 None outside 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 None when a character is outside the alphabet.
geohash_encode
Geohash of len characters (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”); None outside 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. south says 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 None is 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.