Skip to main content

Hardware-accelerated H3 library

Project description

H3 SYCL Bridge

Python API

H3 Turbo provides drop-in replacements for common H3 functions, optimized for NumPy arrays and GPU acceleration.

import h3_turbo
import numpy as np

# 1. Lat/Lon to Cell
lats = np.random.uniform(37.7, 37.8, 1_000_000)
lngs = np.random.uniform(-122.5, -122.4, 1_000_000)
resolution = 9

# Returns uint64 array of H3 indices
cells = h3_turbo.latlng_to_cell(lats, lngs, resolution)

# 2. Cell to Parent
parent_res = 5
parents = h3_turbo.cell_to_parent(cells, parent_res)

# 3. Grid Disk (k-ring)
k = 2
# Returns (N, max_k_size) array, padded with 0s
disks = h3_turbo.grid_disk(cells, k)

# 4. Cell to Boundary
# Returns (N, 7, 2) array of [lat, lng] coordinates
boundaries = h3_turbo.cell_to_boundary(cells)

# 5. Spatial Join (Point-in-Polygon)
# Efficiently check if points are within a set of zones
zones = np.array([0x8928308280fffff], dtype=np.uint64)
mask = h3_turbo.spatial_join(cells, zones, resolution)

Spark / Databricks Integration

H3 Turbo includes optimized Pandas UDFs for PySpark.

from pyspark.sql.functions import col
from spark_h3_turbo import (
    latlons_to_h3s_udf,
    cell_to_parent_udf,
    grid_disk_udf,
    spatial_join_udf
)

# 1. Lat/Lon to Cell
df = df.withColumn("h3", latlons_to_h3s_udf(9)(col("lat"), col("lon")))

# 2. Cell to Parent
df = df.withColumn("parent", cell_to_parent_udf(5)(col("h3")))

# 3. Grid Disk
df = df.withColumn("kring", grid_disk_udf(2)(col("h3")))

# 4. Spatial Join (Broadcast)
zones_list = [0x8928308280fffff] # List of H3 integers
df = df.withColumn("in_zone", spatial_join_udf(zones_list, 9)(col("h3")))

When choosing a wheel file or Docker image for AWS, refer to the following table:

AWS Instance GPU Architecture GPU_ARCH
g4dn NVIDIA T4 Turing sm_75
g5 NVIDIA A10G Ampere sm_86
p4d NVIDIA A100 Ampere sm_80
g6 NVIDIA L4 Ada Lovelace sm_89
g6e NVIDIA L40S Ada Lovelace sm_89
p5 NVIDIA H100 Hopper sm_90
p5e NVIDIA H200 Hopper sm_90
g7e NVIDIA B200 Blackwell sm_100

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

h3_turbo-1.0.8-cp314-cp314-manylinux_2_39_x86_64.whl (60.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

h3_turbo-1.0.8-cp313-cp313-manylinux_2_39_x86_64.whl (60.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

h3_turbo-1.0.8-cp312-cp312-manylinux_2_39_x86_64.whl (60.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

h3_turbo-1.0.8-cp310-cp310-manylinux_2_39_x86_64.whl (60.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

File details

Details for the file h3_turbo-1.0.8-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for h3_turbo-1.0.8-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 80bb856d035206d5403dd185f5f7defff0c47e180277cbc491cb35dde4357d7d
MD5 010b84b000646d52ae0a5620072319db
BLAKE2b-256 939d4779ed213c83c2b44486e44e70c7b12c605549586912ff1787c0d2e97e47

See more details on using hashes here.

File details

Details for the file h3_turbo-1.0.8-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for h3_turbo-1.0.8-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 a3b5e96967d1030fb4fb6fc70064a7361d382afd0af612ba1a8e1535d11050a5
MD5 4bd3668e29172f9e156d508f94d4949b
BLAKE2b-256 f4492420b1f5e51ed461e86868a2b9a6c192e414242b8b8d4b3c6d63b31cd0fd

See more details on using hashes here.

File details

Details for the file h3_turbo-1.0.8-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for h3_turbo-1.0.8-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 029f22edd94da8eb9ff3dc13003a2e4ff886a4f503e5b163e790cabb290e33d2
MD5 99c9de989d6b12aa693b1e9f7b49c1ff
BLAKE2b-256 686714690717e1f382be9028c5f6ba77b766525e512488a6cfee08c5eecb37c9

See more details on using hashes here.

File details

Details for the file h3_turbo-1.0.8-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for h3_turbo-1.0.8-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f550c685ea12c386fb5cf95d7d168f83215a6314554292bcea8d8751bee61de8
MD5 12c9f8d40812b849115d29dae2168b53
BLAKE2b-256 d61b24756f5a7d2d525f3b26624e764828e30912b6372b62a45b34f22d8f908b

See more details on using hashes here.

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