Skip to main content

No project description provided

Project description

CI Package version

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.

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

rusty_polygon_geohasher-0.5.0.tar.gz (60.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rusty_polygon_geohasher-0.5.0-cp311-abi3-win_amd64.whl (331.7 kB view details)

Uploaded CPython 3.11+Windows x86-64

rusty_polygon_geohasher-0.5.0-cp311-abi3-win32.whl (307.9 kB view details)

Uploaded CPython 3.11+Windows x86

rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl (719.3 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_i686.whl (759.3 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ i686

rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_armv7l.whl (780.8 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARMv7l

rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl (672.9 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (515.3 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (551.8 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (506.3 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARMv7l

rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (496.0 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_11_0_arm64.whl (442.1 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl (462.4 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file rusty_polygon_geohasher-0.5.0.tar.gz.

File metadata

  • Download URL: rusty_polygon_geohasher-0.5.0.tar.gz
  • Upload date:
  • Size: 60.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rusty_polygon_geohasher-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f09df8a8ec998769a77638b238312e9c42ec569fa64bbe73342c3ac03ddb662b
MD5 5cf38abbbe4d639fc55d8d824591523c
BLAKE2b-256 91a4ff85f2eba68fe9e5c4f6d1b0a1895e9751f4429fcd016a554f4553db9a38

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0.tar.gz:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 90961705e8eb2788d4b49143c4d9088c5783cde24a2a9f745e3953323f248c0b
MD5 772912ce902da274a0e657cec609caa5
BLAKE2b-256 a12b34192f2f9d4a8d88f9deab2ee0c3855291136d045b0b10e3a59499c3bdb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-win_amd64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-win32.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 37d793cb27d5a6293ca16ec0ee4d792eb56140b2a0ef7567d13cd08c67b1b075
MD5 55c25320230e5e829567c800420ce68f
BLAKE2b-256 caa04ee3db02918e7ee9dbf3bfcac89e4611fe642b175f59232881fe09ab20a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-win32.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 224edfedb519e1af8986d20d3b0ad10ebec7b3e83125ac929ce071536af68125
MD5 19259c7340e5011809bf44e042dbd422
BLAKE2b-256 4908a6a9170d0cfd25fa751a226c84f111e703a55990375c15deb78faf17838e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 58295269ed3a2a17ec708de86a1994b9c2304be6654648c03b1d71964f66c149
MD5 e4974cde23a26a8a46367bcb37e3e0e6
BLAKE2b-256 55e7f0faffae755a3f53f9842eb971d53b70a80bcba46fa290fe4a221831722c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_i686.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 0a213724c4277bbe347e78298d3ac55ae507366f40dbee90c3fc41d074ba9c37
MD5 fa856d287e3976263288bb5e40d58da6
BLAKE2b-256 05cbfdb92ff8aa5a07e6d13c2d55cf1892502c8e36b565cc0f819d0fdbbddc50

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_armv7l.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c4ed98c94fcf2ab9f43a257620d2659b18f9e70bf22d7851e6b0de241ec70f85
MD5 81d5880e77c516402d70cb6c77114637
BLAKE2b-256 272dcdd9c7a1fd2ea3f0149d2fb74a0032d979636fe96a9f63c3c55acfbcbfc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0067fbd69c24783a53454478b40113af9139fa037c9552cc02d3435f716b093
MD5 d8a7223d0159a7e8977709bf741848e1
BLAKE2b-256 76a3c58a13f868c8c4ca870083fcec5a7eb86827151f9f922e1cc86ed7cc4db6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ba03f0ba5fdc3523c3bfd30ea2000ce9fc813146e7592838d2f05fd65e3048a5
MD5 cd5a35c06f45563965b75d049f70c751
BLAKE2b-256 8a368fe28b6ae2fdbea71e91b99f040ea669b11ddea67cde54930844555be4c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 c529235b7eb3e962c4cf469e40b2bf3510f2536e6c2cfee494544ce04e79819c
MD5 c41a1a631ed594b31b8ae115c85702cd
BLAKE2b-256 09de07bd7e00dd861a45a1f482d92f4ad5645e9d50054977258cb744baa68f4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 456037a8c6a6becfeccece48f9b2fa38fec9c7ee20e62fcf686c437d65889c4d
MD5 c928bfc49fc7861a179a0538eeec8f34
BLAKE2b-256 1fd18505b244cce1cdce835f3b2c37d703c64e04ae5ea4c66ec14f075d35ac17

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14d7937d027169d6747d56e808b17e42956ed09f5de1eaf6ecd0ce958f27e422
MD5 3c40611f2fde051f41f8d143812dde73
BLAKE2b-256 4bcad44c1407b1813fa72c776dac7b62e30815425d91d87ace8ff76d5891c5de

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7a4013708e7b0a57d4fcd410293863e6cd6ca11bee3c50b446e78bcb9329e040
MD5 adf81454e098720b1a27b7f49009e74f
BLAKE2b-256 0153d271d3ad741f1095e73af2bdea81d56d5467b6909ec0638cb2863d5aac45

See more details on using hashes here.

Provenance

The following attestation bundles were made for rusty_polygon_geohasher-0.5.0-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: CI.yml on nexmoov/rusty-polygon-geohasher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page