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 Distribution

h3_turbo-0.1.6.tar.gz (14.9 kB view details)

Uploaded Source

Built Distributions

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

h3_turbo-0.1.6-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.6-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.6-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.6-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.6.tar.gz.

File metadata

  • Download URL: h3_turbo-0.1.6.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for h3_turbo-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f9983f2170db287c867ad3f0fdc468c127585225bee5cb5653477fb9284e8662
MD5 72c0f5f47614c3e23dc5a4090c36f336
BLAKE2b-256 c82616ec67ad8bb223c10ac22d9c6c77e4d62969c90b04b7d6a878e683d72017

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.6-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f6cbca92fbe2707adfadbaf1b9259d9ab6dc85b90f6559938cefbf87107bf685
MD5 f6ea27cf3ed78e8d89c1ff8470e13650
BLAKE2b-256 ffd441d889f49ca619d5260a0293a8d0f18e2ae7a19e6405cc518cb409b65be7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.6-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cdf5f2fc17428af9a1fdb39d63110dd61240d597547f24956e61c45b4cb09284
MD5 80ab75d8fbb866c10f099b22521e9a14
BLAKE2b-256 3440d0c2b134ddf4fbfce0425cf7de91c6d25ff4d457b87a4f0f5017cc593244

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.6-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1fd0ff4855399a03415a27e509f4e4cd72606b77ff09473b8ec73fe9d608e75f
MD5 6d2b2cbc69b8fdcedbf3ab0b79940916
BLAKE2b-256 9cdffa106ee7a5c58b42d5780701e9d690700563ce733a29e46013d0cc93f5dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.6-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 ad33d9793e213993f5e06f924e6af5aefeecf7230d1aa134af87e76baf56089c
MD5 789ee2c0e445cb56ec2c275d4b11f337
BLAKE2b-256 ffc7805caf49c59b93cc5546adeb0591bbdccd5b9159e50e9219142addba06ac

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