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
H3 algorithms provided using the performant h3o library.
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.
Limitations
Not all functionalities of the H3 grid are wrapped by this library, the current feature-set was implemented when there was a need and the time for it. As a opensource library new features can be requested in the form of github issues or contributed using pull requests.
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.19.0-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc25227c1c716b5cec8793541b14030e78247720a58a726e041090c65bae1fb5 |
|
MD5 | 6db7e156df0524836d9e60ebff252193 |
|
BLAKE2b-256 | 486b55016775b7dbcf26d65c287681035c6bc3fc50104da8994947ee34ceadcd |
Hashes for h3ronpy-0.19.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60a64aa4630adeaec924c7ce6962cb16442d9f260ef8c13816f634d1207d9b93 |
|
MD5 | 090ae68ae493a2041e69f878da9327e9 |
|
BLAKE2b-256 | e284c86cb2cb3ea62b21fe77c64afcf2373c68d437159f0eab31b382dee9fcf7 |
Hashes for h3ronpy-0.19.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1607f2c86b6e28a13f9f325ed664e6469c664a4805c84f41c6d8db858c20dd23 |
|
MD5 | 4ed48d1fb4396fed7a2741b782661179 |
|
BLAKE2b-256 | 2a787ec2299382d0c07cb3fb3b9f242f26379e7465ba34814f652880ef9014b3 |
Hashes for h3ronpy-0.19.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa34134d28d87097d510e599434989ac93e40a96227c207207bbf2d633c40941 |
|
MD5 | 5b10ba23b84429301528e81db2b5b040 |
|
BLAKE2b-256 | fff29a1b5b26a7ee551083e21560e1a1ce5109b39188649e6bcd280e18708e9e |
Hashes for h3ronpy-0.19.0-cp38-abi3-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87f0c8a138612736e3c6aa0957511e45a9bed940df6307090837c638becc0127 |
|
MD5 | cb5c107b1f115ef777d3678ec33a4549 |
|
BLAKE2b-256 | ca1db070b0a2f0aa6e5a15f1569a30f3483ac041b15f4ef145f366876a5df100 |