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

File metadata

  • Download URL: h3_turbo-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 5a8490bd3869a4c03360271eda18019d6dfe9d64b8c0f486b0391264362bf3ed
MD5 5fd8a6a36c5106d5c6f1f60d251150a9
BLAKE2b-256 bfb2fe855f813a0921c9ffa798a5932674cf18e2c1e89c366d3154794283c707

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.11-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fa5cda6d596fd488c2807eb340c37fdb957bce2805e21dbc117f3f779cc1f9e4
MD5 d48ad78e685506c5551e57e50242d7c0
BLAKE2b-256 a3ffea152d3f1981494800c635a037331ad2c41282d5af1ba3c0f8d10ae52faf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.11-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 85618d89baf47c3e3fde03d13063007a37872866c4760eabb181f3d2a4dd5cb3
MD5 592e61153ec66d73e2e588cfb15bda4b
BLAKE2b-256 a14b832b224818b21e6ac8d5f2419219d963abc1fccc970aa1c090330227dd34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.11-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d2fd4f62483fede0aa4bdedb6d0adf6e053fdd17235a021e399dfb541244e324
MD5 2b1cf68068ccfa6d50c0ec04e296049a
BLAKE2b-256 646b3c3f76e08c071657f2be001aae3d62a76e05cc172f2f3af1a9d73e12d6b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.11-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 cb0c102bb2e39f965433e2fad19cb6948d70dfe7ca1b731fc3e8975729e12b2e
MD5 13ba8aa2268d08cf9afea460758beee1
BLAKE2b-256 629de77453cc707b3193228a46b43d4364281049ed595cedfe4aaba6fff3ef06

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