global_digital_address 1.0.0

Square-cell Web Mercator encoder/decoder for globally unique grid codes
Documentation
  • Coverage
  • 42.86%
    6 out of 14 items documented0 out of 5 items with examples
  • Size
  • Source code size: 13.35 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.87 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 20s Average build duration of successful builds.
  • all releases: 20s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • sumitsharansatsangi/global_digital_address
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • sumitsharansatsangi

README.md

global_digital_address

Square-cell Web Mercator encoder/decoder for globally unique grid codes (6×6 subdivision per level).

Features

  • Web Mercator (EPSG:3857) math with MAX_LAT = 85.05112878°
  • Deterministic 6×6 symbol grid per level
  • Grouping: AAAA-BBBB-CC for 10-char codes; otherwise groups of 4
  • Reverse decode to cell center
  • Approximate cell size by code length

Install

# Cargo.toml
[dependencies]
global_digital_address = "1.0"

Usage

use global_digital_address::{get_digi_pin, get_lat_lng_from_digipin};

let code = get_digi_pin(28.6139, 77.2090, 10).unwrap();
let center = get_lat_lng_from_digipin(&code).unwrap();
println!("{code} -> {}, {}", center.latitude, center.longitude);

CLI example

cargo run --example encode_decode

License

MIT © Sumit Kumar