Skip to main content

Wrapper over Shapely that returns the set of geohashes that form a Polygon

Project description

# polygon-geohasher
Polygon Geohasher is a Open source Python package which converts a
polygon into a set of geohashes with arbitrary precision. More
conversely, it can obtain the set of geohashes inside a polygon or
geohashes that touch (intersects) the polygon. This library uses
[python-geohash]( and

## Requirements
Polygon Geohasher requires:

- Python >= 3.x.
- GEOS >= 3.3 (due to shapely).

## Installing
Linux users can get Polygon Geohasher from the Python Package Index with
pip (8+):

`$ pip install polygon-geohasher`

## Usage
Here are some simple examples:

from shapely import geometry

polygon = geometry.Polygon([(-99.1795917, 19.432134), (-99.1656847, 19.429034),
(-99.1776492, 19.414236), (-99.1795917, 19.432134)])
inner_geohashes_polygon = geohashes_to_polygon(polygon_to_geohashes(test_polygon, 7))
outer_geohashes_polygon = geohashes_to_polygon(polygon_to_geohashes(test_polygon, 7, False))


This function receives a geohash, and returns a Shapely's Polygon.


This function receives a set of geohashes, and returns a Shapely's Polygon or MultiPolygon.

`polygon_to_geohashes(polygon, precision, inner(optional))`:

This function receives a Shapely's Polygon, the precision of geohashes that
will be used to create a polygon and returns a set of geohashes
(strings) which covers the polygon. It also receives an optional
parameter `inner` that defines the way how those polygons will be created.
If inner only contained geohashes will be used, otherwise intersected will.

For instance you can see resulted geohashed polygons with both options.


#### Donations

If you want to make any donation you can send to:

- [BCC]( 1CmuSwFD9qghEfJ4DdSiRWLxfvK5Srfqsg

Project details

Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
polygon_geohasher-0.0.1-py2-none-any.whl (6.0 kB) Copy SHA256 hash SHA256 Wheel py2
polygon-geohasher-0.0.1.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page