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.9-cp314-cp314-manylinux_2_39_x86_64.whl (60.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

h3_turbo-1.0.9-cp313-cp313-manylinux_2_39_x86_64.whl (60.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

h3_turbo-1.0.9-cp312-cp312-manylinux_2_39_x86_64.whl (60.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

h3_turbo-1.0.9-cp310-cp310-manylinux_2_39_x86_64.whl (60.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

File details

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

File metadata

File hashes

Hashes for h3_turbo-1.0.9-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 080246eefb2f7d8232c8b097236b7c6012e8f4cad7a6a1d226f9d0cddf68ebd5
MD5 6422888a96b8883d4ea2ef256e91de56
BLAKE2b-256 ab07186916f8ba07f677731e60b21004c2fe347ed36daf79d7b391b65e1b3b8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-1.0.9-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 71b1c5369417329f5cb9a683c48e4cf8199f161fcc7e3751c3670befb8b62b5a
MD5 a703c2648f9f037796ac4dfc0986d6ff
BLAKE2b-256 c4509dfa17f01584a2dedca079b06437349374e42acad01de900208f3ff68456

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-1.0.9-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fcb9fc9a5e3cf1840924fb59c6d81243445eca8a58a10d08e39523b71f9bb33b
MD5 00f1f8bfd0da205e3cf151c449148ec9
BLAKE2b-256 01eb9476147bd2232d887eb35ad3f6a8f3770a2bcb1ddf9327b6cb92008ab5d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-1.0.9-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 e82bbfdda99be098965765c77a0524f91fc9a92bedbc40237e98d077592f9b9f
MD5 4ec7c8e552e7b83b6e441dc807020169
BLAKE2b-256 0dfe143f034ad7705e5efcdd7106474186981c552c83dbd88ef6955daecf7b91

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