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 (
    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")))

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

File metadata

File hashes

Hashes for h3_turbo-0.1.4-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 0392fdab99d0d00e33898f8e9c9d8f6a77158feecfb9419b15554eb5dcc491ad
MD5 0295aa664995a84d1107f43e69f641ff
BLAKE2b-256 aebb43357ad742953f0401fa687d029681d2b9a2c1fc6023858f7f0f650f3efa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.4-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 7a3cff3f6ed75296ac7357de1811110aedeac5e6330b130264f2a17a9a9026a9
MD5 bd2d32436ff58af7feb9dcff9b16ab32
BLAKE2b-256 4504b903bb26dc71593aa1212ca750cf0abe2ab2f65ff8a1f77e1b6dc0cc3abe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.4-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 337d8caf99705eb6c0085300af35ca36ed982c977de7d0e804a000fa47e6a882
MD5 5765076d7cf49e2ed4a344f63c6b6597
BLAKE2b-256 f81287a5a9516a9d015ab677b0983946fd64cfb356ef96396c6c67a7de031c89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.4-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 3511021cecceadca14292ed0ab6abd1e9bb0574a0421e00c0334a4e272e200d4
MD5 64279495799350927a466fb47dd6ac7c
BLAKE2b-256 a2cbc590ed91da79e42dbd43749e8c98194e9a828744f83b71fb9372c60cbe25

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