https://github.com/uber/h3-py
Python bindings for H3, a hierarchical hexagonal geospatial indexing system
https://github.com/uber/h3-py
geocoding geospatial gis h3 hexagonal-architecture python uber
Last synced: 4 months ago
JSON representation
Python bindings for H3, a hierarchical hexagonal geospatial indexing system
- Host: GitHub
- URL: https://github.com/uber/h3-py
- Owner: uber
- License: apache-2.0
- Created: 2018-06-12T22:39:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-06T16:41:09.000Z (12 months ago)
- Last Synced: 2024-10-07T02:16:41.193Z (12 months ago)
- Topics: geocoding, geospatial, gis, h3, hexagonal-architecture, python, uber
- Language: Python
- Homepage: https://uber.github.io/h3-py
- Size: 36.7 MB
- Stars: 815
- Watchers: 32
- Forks: 131
- Open Issues: 83
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- Contributing: docs/contributing.md
- License: LICENSE
Awesome Lists containing this project
README
# **h3-py**: Uber's H3 Hexagonal Hierarchical Geospatial Indexing System in Python
[](https://badge.fury.io/py/h3)
[](https://pypistats.org/packages/h3)
[](https://anaconda.org/conda-forge/h3-py)
[](https://github.com/uber/h3/releases/tag/v4.2.1)
[](https://github.com/uber/h3-py/blob/master/LICENSE)[](https://github.com/uber/h3-py/actions)
[](https://github.com/uber/h3-py/blob/master/.github/workflows/lint_and_coverage.yml#L31)Python bindings for the [H3 core library](https://h3geo.org/).
- Documentation: [uber.github.io/h3-py](https://uber.github.io/h3-py)
- GitHub repo: [github.com/uber/h3-py](https://github.com/uber/h3-py)## Installation
From [PyPI](https://pypi.org/project/h3/):
```console
pip install h3
```From [conda](https://github.com/conda-forge/h3-py-feedstock):
```console
conda config --add channels conda-forge
conda install h3-py
```## Usage
```python
>>> import h3
>>> lat, lng = 37.769377, -122.388903
>>> resolution = 9
>>> h3.latlng_to_cell(lat, lng, resolution)
'89283082e73ffff'
```## APIs
[api_comparison]: https://uber.github.io/h3-py/api_comparison
[api_quick]: https://uber.github.io/h3-py/api_quickWe provide [multiple APIs][api_comparison] in `h3-py`.
- All APIs have the same set of functions;
see the [API reference][api_quick].
- The APIs differ only in their input/output formats;
see the [API comparison page][api_comparison].## Example gallery
Browse [a collection of example notebooks](https://github.com/uber/h3-py-notebooks),
and if you have examples or visualizations of your own, please feel free
to contribute![walkthrough]: https://nbviewer.jupyter.org/github/uber/h3-py-notebooks/blob/master/notebooks/usage.ipynb
We also have an introductory [walkthrough of the API][walkthrough].
## Versioning
`h3-py` wraps the [H3 core library](https://github.com/uber/h3),
which is written in C.
The C and Python projects each employ
[semantic versioning](https://semver.org/),
where versions take the form `X.Y.Z`.The `h3-py` version string is guaranteed to match the C library string
in both *major* and *minor* numbers (`X.Y`), but may differ on the
*patch* (`Z`) number.
This convention provides users with information on breaking changes and
feature additions, while providing downstream bindings (like this one!)
with the versioning freedom to fix bugs.Use `h3.versions()` to see the version numbers for both
`h3-py` and the C library. For example,```python
>>> import h3
>>> h3.versions()
{'c': '4.1.0', 'python': '4.1.1'}
```