Skip to main content

README

Project description

geojsonhash

CI Release Pypi License Code style: black

This package is responsible for generating identifiers for geojson objects. To do so, it makes use of the pygeohash library in charge of generating the identifiers of the different points contained in the geojson.

In this implementation, individual points are ignored, treating the input geojson as a set of polygons defining a surface. The polygons are sorted according to their coordinates while the northwest-most vertex of the polygons defines the starting point for encoding.

Installation

To install the package there are two options: through poetry or by using the pip command

Pip command

$ pip install geojsonhash

Poetry

$ git clone https://github.com/AdrianSeguraOrtiz/geojsonhash.git
$ cd geojsonhash
$ poetry install

Example

An example is shown below:

from geojsonhash import get_geojson_id
import json

with open("./resources/geojson.json") as geo_d:
    geojson = json.load(geo_d)

geojson_id = get_geojson_id(geojson)
print(geojson_id)

To run it through console we can do:

$ cd examples
$ python example.py

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

geojsonhash-0.1.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

geojsonhash-0.1.1-py3-none-any.whl (4.1 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