maidenhead
provides a simple, yet effective location hashing
algorithm. Maidenhead allows global location precision down to 750m
Maidenhead provides 4 levels of increasing accuracy
Level | Precision |
---|---|
1 | World |
2 | Regional |
3 | Metropolis |
4 | City |
pip install maidenhead
or for development version
git clone https://github.com/space-physics/maidenhead
pip install -e maidenhead
All examples assume first doing
import maidenhead as mh
mh.to_maiden(lat, lon, level)
returns a char (len = lvl*2)
mh.to_location('AB01cd')
take any string and returns topleft lat, lon of Maidenhead grid square.
Python:
maidenhead 65 -148
BP65aa
maidenhead BP65aa12
65.00833333333334 -147.99166666666667
We also have Maidenhead conversion for Julia.
Open Location Codes a.k.a Plus Codes are in Python code by Google.