Skip to content
Python Maidenhead <--> WGS84 coordinate conversions
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
archive
maidenhead
tests
.codeclimate.yml
.coveragerc
.flake8
.gitattributes
.gitignore
LICENSE.txt
Maidenhead.py
README.md
mypy.ini
pyproject.toml
setup.cfg
setup.py

README.md

DOI

Actions Status

pypi versions PyPi Download stats

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

Level Precision
1 World
2 Regional
3 Metropolis
4 City

We also have Maidenhead conversion for Julia.

Open Location Codes a.k.a Plus Codes are in Python code by Google.

Install

pip install maidenhead

Examples

All examples assume first doing

import maidenhead as mh

lat lon to Maidenhead locator

mh.toMaiden(lat, lon, level)

returns a char (len = lvl*2)

Maidenhead locator to lat lon

mh.toLoc('AB01cd')

take any string and returns topleft lat, lon of Maidenhead grid square.

Command Line

Python:

python Maidenhead.py 65 -148
You can’t perform that action at this time.