Crate global_digital_address

Crate global_digital_address 

Source
Expand description

global_digital_address Square-cell Web Mercator encoder/decoder for globally unique grid codes.

API:

  • get_digi_pin(lat, lon, levels) -> String
  • get_lat_lng_from_digipin(code) -> Result<LatLng, Error>
  • constants: DIGIPIN_GRID, MAX_LAT
  • approx_cell_size_meters(levels)

Notes:

  • Uses Web Mercator (EPSG:3857) math identical to the JS reference.
  • Longitude normalized to (-180, 180]; latitude clamped to ±MAX_LAT.
  • Grid subdivision is 6×6 per level.

Structs§

LatLng

Enums§

Error

Constants§

DIGIPIN_GRID
6×6 symbol grid (rows top→bottom, columns left→right)
MAX_LAT
Mercator latitude clamp (degrees)

Functions§

approx_cell_size_meters
Approximate cell size (meters) for a given code length. world width / 6^levels
get_digi_pin
Encode lat/lon to a square-cell global code.
get_lat_lng_from_digipin
Decode a DIGIPIN back to the center lat/lon of its cell.