Skip to main content

Python bindings for S2, a hierarchical square geospatial indexing system.

Project description

S2-py

https://img.shields.io/pypi/v/s2.svg https://img.shields.io/travis/JoaoCarabetta/s2.svg Documentation Status

A light wrapper over s2sphere to mirror H3-py API calls.

Installing

pip install s2

Using

Import It

from s2 import s2

Get a s2 square given a point

lat, lon, res = 12, -3, 10
s2_address = s2.geo_to_s2(lat, lon, res)

Get the boundaries of a s2 square

s2.s2_to_geo_boundary(s2_address)

Get squares of a resolution within a polygon

s2.polyfill(geo_json, res)

Features

Table of functions to be implemented in order of priority

h3 functions implemented? issue
geo_to_h3 yes  
h3_to_geo yes  
h3_to_geo_boundary yes  
polyfill yes  
hex_ring no  
k_ring no  
k_ring_distances no  
h3_set_to_multi_polygon no  
h3_to_parent no  
h3_to_children no  
hex_range no  
hex_area no  
edge_length no  
num_hexagons no  
h3_indexes_are_neighbors no  
h3_distance no  
h3_line_size no  

Credits

  • Free software: MIT license

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.9 (2019-11-12)

  • Add option to polyfill to return geometry ids.

0.1.8 (2019-11-12)

  • Add example tests.

0.1.7 (2019-11-12)

  • Basic Documenations.

0.1.0 (2019-11-12)

  • First release on PyPI.

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

s2-0.1.9.tar.gz (12.0 kB view hashes)

Uploaded source

Built Distribution

s2-0.1.9-py2.py3-none-any.whl (4.1 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page