Geohash Lite
GeohashLite is a Python package for dealing with GeoHash code. It support also conversion between GeoJSON and a list of GeoHash.
Installation
Clone this repository
git clone https://github.com/qxzzxq/python-geohash.git
Then install with python
cd python-geohash
python setup.py install
Dependencies
Usage
Coordinates encoding
import geohashlite
geohashlite.encode(48.86913, 2.32275, 7)
Geohash decoding
geohashlite.decode('u09whb7')
Conversion between GeoJSON and GeoHash
# GeoHash to GeoJSON
converter_1 = geohashlite.GeoJsonHasher()
x = ['u09k', 'u095', 'u08g', 'u09h', 'u09e', 'u097']
converter_1.geohash_codes = x
converter_1.decode_geohash(multipolygon=True)
print(converter_1.geojson)
# GeoJSON to GeoHash
converter_2 = geohashlite.GeoJsonHasher()
fc = {
"type": "FeatureCollection",
"features": [
"GeoJSON_Feature",
]
}
converter_2.geojson = fc
converter_2.encode_geojson(precision=4)
print(converter_2.geohash_codes)
Convert a geohash list to geojson (deprecated)
geohashlite.geohash_2_geojson(['u09whb7'])
Convert geojson to a geohash list (deprecated)
fc = {
"type": "FeatureCollection",
"features": [
"a_GeoJSON_Feature"
]
}
geohashlite.geojson_2_geohash(fc, precision=7)
Acknowledgement
Thanks Hiroaki Kawai and Jerry Xu.
Release files for geohashlite 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geohashlite-0.3.2.tar.gz | 14.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geohashlite-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.2 kB
Release files / geohashlite-0.3.2.tar.gz
| Download URL | geohashlite-0.3.2.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb05a3cc1071e9d8cb296afc7d15df2afe7c4512fe40890a0cf1f7702a29d891
|
|
BLAKE2b-256 checksum How to use checksums |
a41e2a09ee8937f6e701473c4e9c319a9971a368fdf8d2aed1c371f76a3644ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/1.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9
|
Release files / geohashlite-0.3.2-py3-none-any.whl
| Download URL | geohashlite-0.3.2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
961a254896799d24e166882a6ad8e1cf1665cefb91b0b78cba2723ceb2c8b3d7
|
|
BLAKE2b-256 checksum How to use checksums |
8cc4f4b70ee1fa896dcb2d65eaec73c8d4dcdd64d6f3ad9c75c22b4a3032e6cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/1.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.9
|