jhrrsn / mapzen-geohash

Python package containing simple tools for encoding and decoding geohashes

Home Page:https://pypi.python.org/pypi/mzgeohash

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mapzen Geohash

Circle CI

A geohash is a convenient method for encoding geographic coordinates, where each character in the geohash adds additional precision. This makes geohashes well suited for indexing mechanisms, grouping geographically located entities, and compactly encoding coordinates based on the level of detail required.

More information about Geohashes:

This Python package contains simple tools for encoding and decoding geohashes.

Installation

Installation using pip:

pip install mzgeohash

Alternatively, download from PyPi or clone this repository, and install using setup.py:

python ./setup.py install

Example usage

>>> import mzgeohash
>>> mzgeohash.decode('xn76urwe1g9y')
(139.76608408614993, 35.681382017210126)
>>> mzgeohash.encode((139.76608408614993, 35.681382017210126))
'xn76urwe1g9y'
>>> mzgeohash.neighbors('xn76urwe1g9y')
{'c': 'xn76urwe1g9y',
 'e': 'xn76urwe1gdn',
 'n': 'xn76urwe1g9z',
 'ne': 'xn76urwe1gdp',
 'nw': 'xn76urwe1g9x',
 's': 'xn76urwe1g9v',
 'se': 'xn76urwe1gdj',
 'sw': 'xn76urwe1g9t',
 'w': 'xn76urwe1g9w'}

Contributing

Please open a Github issue with as much of the following information as you're able to specify, or contact us for assistance.

Contact

Transitland is sponsored by Mapzen. Contact us with your questions, comments, or suggests: hello@mapzen.com.

About

Python package containing simple tools for encoding and decoding geohashes

https://pypi.python.org/pypi/mzgeohash

License:MIT License


Languages

Language:Python 100.0%