Data science toolkit for the H3 geospatial grid
Project description
A data science toolkit for the H3 geospatial grid.
This library is not a substitute for the official python h3 library - instead it provides more high-level functions on top of H3 and integrations into common dataframe libraries.
Documentation is available on https://h3ronpy.readthedocs.io/.
Features
Build on Apache Arrow and pyarrow for efficient data handling.
Dedicated APIs for the the pandas and polars dataframe libraries. The pandas support includes geopandas.
Multi-threaded conversion of raster data to the H3 grid using numpy arrays.
Multi-threaded conversion of vector data, including geopandas GeoDataFrames and any object which supports the python __geo_interface__ protocol (shapely, geojson, …).
Most parts of this library aim to be well-performing. Benchmarking the conversion of 1000 uint64 cell values to strings using
a simplistic list comprehension calling h3-py h3_to_string
a numpy vectorized (numpy.vectorize) variant of h3-py h3_to_string
the cells_to_string function of this library (release build)
leads to the following result on a standard laptop:
---------------------------------------------------------------------------------------------- benchmark: 3 tests ---------------------------------------------------------------------------------------------
Name (time in us) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_cells_to_string 48.4710 (1.0) 75.5000 (1.0) 52.4252 (1.0) 1.5461 (1.0) 52.0330 (1.0) 0.4890 (1.0) 307;448 19.0748 (1.0) 4090 1
test_h3_to_string_python_list 290.5460 (5.99) 325.8180 (4.32) 297.5644 (5.68) 4.8769 (3.15) 296.1350 (5.69) 8.2420 (16.85) 806;4 3.3606 (0.18) 2863 1
test_h3_to_string_numpy_vectorized 352.9870 (7.28) 393.8450 (5.22) 360.1159 (6.87) 3.7195 (2.41) 359.4820 (6.91) 3.8420 (7.86) 447;131 2.7769 (0.15) 2334 1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Legend:
Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
OPS: Operations Per Second, computed as 1 / Mean
The benchmark implementation can be found in tests/polars/test_benches.py and uses pytest-benchmark.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for h3ronpy-0.17.5-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e97eb6e5bcf08c100e777f73b382551f0b71868ba9ee3111c1781df7390045f |
|
MD5 | 8765861380a408b7562685fd772cbe73 |
|
BLAKE2b-256 | 1042b81aa61a747f92c573484a01975a3ed66474c899270fb103c3a6f2f1bb4a |
Hashes for h3ronpy-0.17.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5872b0c10d87ff67887b492140b7f656f0bb21c68659d99468c42d787ee80be7 |
|
MD5 | 458bd2c51a5cce1a6e163a5118fa0bec |
|
BLAKE2b-256 | fa123298ccdf8742dc9e8b1636a1a3d0f073a8b49d470fa933f09c4a081a1564 |
Hashes for h3ronpy-0.17.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c01ceb6b2ac5c3716d0d261119f2b447ff831e22cf9a9c02a1c64a8f0bcee8 |
|
MD5 | da2fe0c29861861bbf045c605498140c |
|
BLAKE2b-256 | 9a4a569c1af35baeb8b9bfa8b3642e26280fa7eeb2f5e4b6f0fe591376848f37 |
Hashes for h3ronpy-0.17.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43b0c69a4a155d0ceb513fc33ecd7e2379f86137269b205c51db628edfccc0be |
|
MD5 | bcee978f5032306804dbf51fb0c25710 |
|
BLAKE2b-256 | 200f171fd7b7f8b266d44afd2b21c1f87e2dc53d3e082c878e541b4a4195970f |
Hashes for h3ronpy-0.17.5-cp38-abi3-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb09eaedcd9d594903019cedcf0251c6a504b4baa4b2f7db7c5cf98287522cab |
|
MD5 | 3c9b21de9dded98e9968c6103ba4d530 |
|
BLAKE2b-256 | eee7000d12a1b8b5a08c8993e660a19e528bcca342f323f7dd59a4d02a16f232 |