rusty-polygon-geohasher
A Rust-backed Python library for geohash operations: converting Shapely polygons to geohash sets, encode/decode, and geography expansion. All compute-heavy paths use Rayon for parallelism.
Originally based on polygon-geohasher (pure Python).
The encode/decode functions are a maintained replacement for pygeohash-fast, which is no longer actively maintained.
Installing
pip install rusty-polygon-geohasher
Usage
Polygon → geohash set
import geohash_polygon
from shapely import geometry
polygon = geometry.Polygon([(-99.1795917, 19.432134), (-99.1656847, 19.429034),
(-99.1776492, 19.414236), (-99.1795917, 19.432134)])
inner = geohash_polygon.polygon_to_geohashes(polygon, precision=7, inner=True)
outer = geohash_polygon.polygon_to_geohashes(polygon, precision=7, inner=False)
Encode / decode
All functions use (lng, lat) order consistently — encode takes (lng, lat) and all decode
functions return (lng, lat, ...).
# Single encode/decode
h = geohash_polygon.encode(lng=-73.554, lat=45.508, precision=7)
lng, lat, lng_err, lat_err = geohash_polygon.decode_exactly(h)
# Batch (parallel via Rayon)
hashes = geohash_polygon.encode_many(lngs=[...], lats=[...], precision=7)
centers = geohash_polygon.decode_many(hashes) # list of (lng, lat)
exact = geohash_polygon.decode_many_exactly(hashes) # list of (lng, lat, lng_err, lat_err)
# Optional thread count
geohash_polygon.encode_many(lngs, lats, 7, num_threads=4)
geohash_polygon.decode_many(hashes, num_threads=4)
geohash_polygon.decode_many_exactly(hashes, num_threads=4)
Expand geohash mappings
Expand each geography's geohash set outward by a given distance in metres. Useful when you want to count or join points-of-interest slightly outside a geography's boundary.
# Single group
expanded = geohash_polygon.expand_geohashes(["f25dvz3", "f25dvz4", ...], expansion_m=500.0)
# Multiple groups — result[i] is the expanded version of groups[i]
groups = [["f25dvz3", "f25dvz4", ...], [...]]
expanded_groups = geohash_polygon.expand_geohash_mapping(groups, expansion_m=500.0)
The hop count is derived from the minimum cell dimension (accounting for latitude-dependent cell width), so expansion is accurate in all directions including east/west at high latitudes. All hashes in a group must have the same precision. Geography expansion runs in parallel across groups.
WKB / EWKB output
Convert geohash bounding boxes to binary WKB or EWKB polygons for direct use
in DuckDB (ST_GeomFromWKB) or PostGIS geometry columns.
hashes = ["f25dvz3", "f25dvz4", ...]
# Plain WKB — 93 bytes per hash
wkb_list = geohash_polygon.decode_many_to_wkb(hashes)
# EWKB with embedded SRID — 97 bytes per hash (default srid=4326)
ewkb_list = geohash_polygon.decode_many_to_ewkb(hashes)
ewkb_list = geohash_polygon.decode_many_to_ewkb(hashes, srid=32632)
# Optional thread count
geohash_polygon.decode_many_to_wkb(hashes, num_threads=4)
geohash_polygon.decode_many_to_ewkb(hashes, num_threads=4)
Metadata
Release files for rusty-polygon-geohasher 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rusty_polygon_geohasher-0.7.0.tar.gz | 108.8 kB | Details |
Built distributions (wheels)
Total release size: 48.2 MB
Release files / rusty_polygon_geohasher-0.7.0.tar.gz
| Download URL | rusty_polygon_geohasher-0.7.0.tar.gz |
|---|---|
| Size | 108.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25c53d47e7c01dbad23c0ff345865f53eac0767272fa31d232a4f4874c3acf46
|
|
BLAKE2b-256 checksum How to use checksums |
419b9ac0f551013b7c17387df2be178bad6614d015d3934a8fdca03636c76d6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-win_amd64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a3b6822b3ed8503c8b304a87d7cfaa14d86069c19337f6a2d51091150b43904c
|
|
BLAKE2b-256 checksum How to use checksums |
706abcdc8da89f3c62a7eac702350b161f8435b4f4bcdf89cd9dc3a742f6ca3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-win32.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-win32.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.11 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
9f4e77736f37bd717fe24c8bbd8db413a20c5d65d665ee101a156ae1f86688d1
|
|
BLAKE2b-256 checksum How to use checksums |
9c383fe18b6e6bd6b70dbc92b54bf1a42a2f5c71242f6ce38f34cf8a23fc4625
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_x86_64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2109d169fcf50c6b86b708dc07b556cfd44f5f2a4bae52d414c93fafa7fd6eb5
|
|
BLAKE2b-256 checksum How to use checksums |
e82cdc77f20e16b2399f1a4341396fb5ee0b8e3133ec36c6eeb9e2299f87fb92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_i686.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
883f90a4b052acf6c800baa2b60e6ab8f864eae0ed00caf20a2c5d8774af9c11
|
|
BLAKE2b-256 checksum How to use checksums |
5aa5fbe64f20c3b4e7910284fbb1626ea36b489e96eb9a02fb04e43528a05002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_armv7l.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.11 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
832c9d356ff030596abcbfb86d84a944c6803f787cc95440300138b9b7b996dc
|
|
BLAKE2b-256 checksum How to use checksums |
d3798bb6499cd72d129877d4f00d770ecfb8b4d9364d1e90289d96d83d939f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_aarch64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.11 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ba42b2d161b694f1b1264877b9e9c813a458f003642f0494eff19036e0978ebc
|
|
BLAKE2b-256 checksum How to use checksums |
324e717825f61626700329506ff7453fef07f23050a040411c8bb0a15182cbea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
a1cc271f7b00161403c82da04dda6ba22f14f43faf3acbf57cf3a6e7f8e87a55
|
|
BLAKE2b-256 checksum How to use checksums |
97b795ab25579da058082f59e669bb630ffdbb69bc929e1ea7a9a93e6f6c2235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
c93c86c0a211593a4355420363d8e8adff36e654e287fd03ca417695de929cf2
|
|
BLAKE2b-256 checksum How to use checksums |
e348f6d15d2f4115348755fd37d40191c614121f7d6839384ab5753b63084265
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
709a116e6240b2936a5847bc80f5938ecdc4bec7291f08e5a1be08d76a82e348
|
|
BLAKE2b-256 checksum How to use checksums |
52974d4f8202795cc1c5d7140cbbd4deac6c970ce36c7f9635ea231fd3f7c897
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
2717bec7155ae43fa151cd33a55e71f6090e8084f0fa866a0dc9782cf186a32a
|
|
BLAKE2b-256 checksum How to use checksums |
ecc80386d968b047a146c01745c818116b848d245a415ee1a7e0f8572da43c37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.5 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7821a98280942ed8910aa22d87a8e9a8a2089286ffa41627c71562846f992844
|
|
BLAKE2b-256 checksum How to use checksums |
d68c6671c8ec08281dcd369e3220cb0813483d52cd19b7514b33b3c5025fa997
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / rusty_polygon_geohasher-0.7.0-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | rusty_polygon_geohasher-0.7.0-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
014f6b9509edacb5166c625429333a5e78d92d19ebbcc4f7c06b68a8c93881c5
|
|
BLAKE2b-256 checksum How to use checksums |
2d55701447d042183ff7c598e30762f1f6d22b1a02303f8e5317cdfa9a075a66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency log