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.10.tar.gz (15.2 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.10-cp314-cp314-manylinux_2_39_x86_64.whl (61.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

h3_turbo-0.1.10-cp313-cp313-manylinux_2_39_x86_64.whl (61.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

h3_turbo-0.1.10-cp312-cp312-manylinux_2_39_x86_64.whl (61.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

h3_turbo-0.1.10-cp310-cp310-manylinux_2_39_x86_64.whl (61.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

File details

Details for the file h3_turbo-0.1.10.tar.gz.

File metadata

  • Download URL: h3_turbo-0.1.10.tar.gz
  • Upload date:
  • Size: 15.2 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.10.tar.gz
Algorithm Hash digest
SHA256 e101ed664ca2f9c0b0fd75cd0af93b44ce422124b979ececbab5e57a3a9911ff
MD5 7e876f8066ca192733983b3c37deb13b
BLAKE2b-256 937ac98043efd89527c8850deca83909e70fb3167c815fac956c311f005e30b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.10-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 aa4e113dbfddb6b757a7ba12e5b992e4581b4e52637ea8aeffb52205c40f4453
MD5 36ca8653d8725d3c4960880df71d7640
BLAKE2b-256 2f2ddf71379a76f203981cbbce5d316cb99b705f531fa9d0bbe69fd2b6d97a17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.10-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 5b9fcd6f1a1bd1b7d5f030ff009cb1f5918c6607a271b55de156750def2ac3d2
MD5 a9c071ab1797817e8096677e7cc9f48c
BLAKE2b-256 208569aabdbfbc3c36ba086c3f612e43725a14709d0eab1bc3909adcdbc4f8b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.10-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4e614cc5c7717ba3cc5b71e07417606a44a25a899d7069f931dddc5e322bb11a
MD5 3ab7c3eb13fbb0d975c1533e6664884e
BLAKE2b-256 199d5fbde4072664a42420fdd75f1d863acc2f9abe36b50e110228aeee90caee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.10-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1bbe4f0078b398d548576d020261b76616e1c19b71ebb47dd0bd02c0c5862914
MD5 8ebca1abad335d8940fd73d6292ebd0d
BLAKE2b-256 146b825dd32070a01525db89a9fa6ef974fed16b90ba633ef77c88f761318547

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