Skip to main content

convert set of geohashes into a geojson boundaries files of the corresponding geohashes

Project description

Geohash to geojson:

This package convert a set of geohashes into a geojson file with the corresponding boundaries

How it works:

Intall the package with the following code:

pip install goohash-to-geojson

Import the function geohash_to_geojson with the following code:

import geohash_to_geojson 

Call the function with a list of the geohashes for example:

geohash_to_geojson.geohash_to_geojson(['snd1j0','snd1jk'])

You ll get the geojson code like that:

'{"type": "FeatureCollection", "features": [{"id": "0", "type": "Feature", "properties": {}, "geometry": {"type": "Polygon", "coordinates": [[[3.0322265625, 36.73828125], [3.043212890625, 36.73828125], [3.043212890625, 36.7437744140625], [3.0322265625, 36.7437744140625], [3.0322265625, 36.73828125]]]}, "bbox": [3.0322265625, 36.73828125, 3.043212890625, 36.7437744140625]}, {"type": "Feature", "properties": {"id": "snd1jk"}, "geometry": {"type": "Polygon", "coordinates": [[[3.043212890625, 36.76025390625], [3.05419921875, 36.76025390625], [3.05419921875, 36.7657470703125], [3.043212890625, 36.7657470703125], [3.043212890625, 36.76025390625]]]}}], "bbox": [3.0322265625, 36.73828125, 3.043212890625, 36.7437744140625]}'

Modify the id :0 in the first feature with the first geohash in your list then copie the text without the first and last ballestics " '' " into a file and save as with a geojson extension and that's it

Requirements:

  • json package
  • polygon_geohasher
  • geopandas
  • shapely

Thank you !

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

geohash_to_geojson-1.3.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

geohash_to_geojson-1.3.2-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

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