libgeohash
A python library for interacting with geohashes.
The library is divided into 3 modules:
- geohash_base: Base functions for interacting with geohashes e.g.
encode,decode,neighbors,bboxetc. - distance_metrics: Distance related functions e.g.
distance,dimensionsetc. - geometry: Functions for conversion of a polygon to a list of geohash and vice versa. e.g.
polygon_to_geohash,geohash_to_polygon. Useful for approximating geographical regions with geohashes. Makes use of shapely library for geometric calculations.
Installation
Linux and Mac users can install the package via pip.
$ pip install libgeohash
Usage
>>> import libgeohash as gh
>>> gh.encode(57.64911, 10.40744, precision = 10)
'u4pruydqqv'
>>> gh.decode('u4pruydqqv', errors = True)
(57.64911264181137, 10.407437682151794, 2.682209014892578e-06, 5.364418029785156e-06)
>>> gh.neighbors('u4pruydqqv')
{'ne': 'u4pruydqrn', 'e': 'u4pruydqrj', 'n': 'u4pruydqqy', 'se': 'u4pruydqrh',
'w': 'u4pruydqqt', 'sw': 'u4pruydqqs', 'nw': 'u4pruydqqw', 's': 'u4pruydqqu'}
# Returns dimensions of the bounding box referred by the geohash in meters. (width, height)
>>> gh.dimensions('u4pruyd')
(152.9, 152.4)
# Returns the great circle distance (Haversine) between two geohashes or coordinates.
>>> gh.distance('u4pruyd', 'u4pruyg')
173.19066702376304
- For more functions and their usage, please refer to the doc strings.
Known issues
- Fails to approximate a polygon spanning across the International Date Line i.e. 180/-180 longitude. Shouldn't be much of a problem since there aren't any geographical entities that actually span across it due to nature of the line itself.
If you happen to find any other bugs, please report them in the issues section.
Metadata
Release files for libgeohash 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| libgeohash-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Release files / libgeohash-0.1.1-py2.py3-none-any.whl
| Download URL | libgeohash-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f7c26afd6a469537facfca4c022c7c2b535cdb05828a0a366275926d77516d46
|
|
BLAKE2b-256 checksum How to use checksums |
91622aecefecfeb1d0a80ea60734689fe8e4af611a8b34251ba1acdeb58ad0b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.5.2
|
Security for libgeohash 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.