Skip to main content

Python module for interacting with geohashes

Project description

[![Coverage Status](https://coveralls.io/repos/wdm0006/pygeohash/badge.svg?branch=master&service=github)](https://coveralls.io/github/wdm0006/pygeohash?branch=master) ![travis status](https://travis-ci.org/wdm0006/pygeohash.svg?branch=master)

Pygeohash is a Python module that provides functions for decoding and encoding geohashes to and from latitude and longitude coordinates, and doing basic calculations and approximations with them.

It is based off of Leonard Norrgård’s [geohash](https://github.com/vinsci/geohash) module, but aims to add more functionality while supporting python 3 as well.

Usage

To use pygeohash:

import pygeohash as pgh

pgh.encode(42.6, -5.6) # >>> ‘ezs42e44yx96’

pgh.encode(42.6, -5.6, precision=5) # >>> ‘ezs42’

pgh.decode(‘ezs42’) # >>> (‘42.6’, ‘-5.6’)

pgh.geohash_approximate_distance(‘shi3u’, ‘sh83n’) # >>> 625441

Installation

Pygeohash has no requirements outside of the python stdlib, and aims to keep it that way if at all possible. To install:

pip install pygeohash

Liscense

A portion of this codebase (geohash.py), is from Leonard Norrgard’s module, which carries the following license:

Copyright (C) 2015 [Leonard Norrgard](leonard.norrgard@gmail.com)

Geohash is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Geohash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Geohash. If not, see [gnu.org](http://www.gnu.org/licenses/).

This derivative work likewise carries the same license:

Copyright (C) 2015 [Will McGinnis](will@pedalwrencher.com)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygeohash-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file pygeohash-1.0.0.tar.gz.

File metadata

  • Download URL: pygeohash-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pygeohash-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d544f88922ef1e03d70ecc83a0cc6065c1ed92ecfbd5048a811f4586417eaf5
MD5 da88c38aba4a7b67c0068b8f3b96f51c
BLAKE2b-256 77d5ff82a400d194a5c2d90f956d7cfd957b5703b15122e911db26e289f2ab41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page