Maidenhead Locator, Lat Lon coordinate convertor
Maidenhead <-> Lat/Lon
maidenhead provides a simple, yet effective location hashing algorithm.
Maidenhead allows global location precision down to 750m
Maidenhead provides 4 levels of increasing accuracy
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
lat lon to Maidenhead locator
mh.to_maiden(lat, lon, level)
returns a char (len = lvl*2)
Maidenhead locator to lat lon
takes Maidenhead location string and returns top-left lat, lon of Maidenhead grid square.
center=True option outputs lat lon of the center of provided maidenhead grid square, instead of the default southwest corner.
The command line interface takes either decimal degrees for "latitude longitude" or the Maidenhead locator string:
maidenhead 65.0 -148.0
The "python -m" CLI is also available:
python -m maidenhead 65.0 -148.0
--center option outputs lat lon of the center of provided maidenhead grid square, instead of the default southwest corner.
We also have Maidenhead conversion for Julia.
Open Location Codes a.k.a Plus Codes are in Python code by Google.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.