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.7.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.7-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.7-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.7-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.7-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.7.tar.gz.

File metadata

  • Download URL: h3_turbo-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 49a0e2f90e399993bf5d7acd29f37aa893cb8b4bad6b966362cea9cf831fc194
MD5 9f8645526f96e1e8ffa0938a48c4d1c0
BLAKE2b-256 d89bb911dcc7e4d10e59c6c13158681fa9c8d8909e195838edaa85e1cd8a5d86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.7-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 6f499a298ccae39f29c2dc2edc35f28ef944acee7d1ba23a36ac9035034a3388
MD5 3252651e4a348e61a0861ed76e911e75
BLAKE2b-256 fbc7bad231590838d89b0ccdbf2f8288c148ac0302ca5ea42e27f81328970639

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.7-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 52893e671d338ddf8b4d5fd4572260f61b1c436596496803387535b81d23f769
MD5 a5092fe5ec3b1794898649aaec1ee29b
BLAKE2b-256 04c89546c4ffc878cb3f57e192358569b8f26593f12d9c3457c71d0d2074c367

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.7-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 32555b6fd242a0e4c7ce69ff33b9fcb615d2c6d26c76dd6c4c92c5f3fe95478c
MD5 57a81459134b00aad378c38e81a44f16
BLAKE2b-256 0120744e30bdc9a3d68837ade4a0f13b8f6e9f0f414d7117f83623b77c3cf176

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.7-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cb93eef7efcc523aba79b25179e523598a6c49627cfd0670b9081dd1edc8c730
MD5 7746d3fb3ea44cb7cb2afed41c9facba
BLAKE2b-256 80040262f97224528a5af23d110afcf0e5213d14a52adb053bc89a07f921961b

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