Skip to main content

SYCL-accelerated H3 geospatial joins

Project description

H3 SYCL Bridge

⚖️ Licensing

FluidGeo H3-Turbo is offered under a dual-license model:

  • Academic & Non-Commercial: Free for research and educational purposes.
  • Commercial & Enterprise: A yearly subscription is required for production environments.
    • Features: 1,186x speedup on Blackwell, zero-copy pinned memory, and priority SYCL kernel support.

For enterprise trial keys and pricing, contact: info@fluidgeollc.com

Installation

H3-Turbo is available on PyPI and comes with pre-compiled "fat" wheels for Linux (CUDA 12.x) supporting NVIDIA Ampere, Ada Lovelace, Hopper, and Blackwell architectures.

pip install h3-turbo

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 (
    latlng_to_cell_udf,
    cell_to_parent_udf,
    grid_disk_udf,
    spatial_join_udf
)

# 1. Lat/Lon to Cell
df = df.withColumn("h3", latlng_to_cell_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")))

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

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

h3_turbo-0.1.5-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-0.1.5-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for h3_turbo-0.1.5-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 17ff1362a065cc38ed9047f5693d775decc187922533de2b21f9a672e4f31612
MD5 99a01adda998806851682222067055a4
BLAKE2b-256 dabf3502ce23bb7049ebff6c96937dabbf0b4317ae4bca0f271829d1f20b250a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.5-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1c0089387d11c29c27eace6998bb302d96e621354a9a3e86e515fefdbb095854
MD5 74f5c532a6579e9333b83dc0e509a03f
BLAKE2b-256 37b12119d0df193e624f6a7dc2e9a611f9efca20158a7a48b85e244277d16527

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.5-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 bb73fa38daa1b14c5a1c499dd02ffcb90a33466878cb10df8d9ce2cb91230d70
MD5 93f74e126f45298ca3cfb39cf4e55d34
BLAKE2b-256 b3293816c1a3970c512e9debb7f928bb844c76ebf22cb464dbbe734dbbafe048

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.5-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 b7430a63ef69e66225c09047054cf40df08fe2ca314174af5bab598adc27c0e2
MD5 63d323270468bb64509654f184372c48
BLAKE2b-256 4c1f181d324527172666928f96b562f6e29ea888ebc09553bd0d8f3063bd9daf

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