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 Distribution

h3_turbo-0.1.3.tar.gz (14.5 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.3-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.3-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.3-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.3-cp311-cp311-manylinux_2_39_x86_64.whl (60.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.39+ x86-64

h3_turbo-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: h3_turbo-0.1.3.tar.gz
  • Upload date:
  • Size: 14.5 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.3.tar.gz
Algorithm Hash digest
SHA256 27e321301595e55306076fad9946a169454e2f5dd1312cc0d4429196fcb479f0
MD5 11a68d6310d63eac283b63a5533f2d50
BLAKE2b-256 57ae4411d023aba7b32ca811697aa061ec9d4e74227513b0bee75b51202193b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.3-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 fc51e84851c605f6a0efb831b399f61b548266489768eb63959abfe721e01016
MD5 2f1d6a743869ccb8e3149966361a5252
BLAKE2b-256 7d5736d60997955c78f28c3dc80e59d591f23f3804279716fab262258a235e82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 87d13fba39a29eea0d2e93ab784a5c3b9992c707767c86f78304ba9755df9e39
MD5 eab6985c8ff515b98fd4f375c02471c1
BLAKE2b-256 57d48c47f868c6c3d96ae56be27ba077a285d5dffed4ed1e454b975f4aab7756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.3-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 deac81e717a877d4b63d33b4378090edddf5b68619b24c38e4a9f388b1ba5afc
MD5 ef4229f8643f86cd6434420d3e086eb3
BLAKE2b-256 c9efaf3f70b1e02798f1f54d85b91f8c4ca0a8debd0ef476cc9267debb05a946

See more details on using hashes here.

File details

Details for the file h3_turbo-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for h3_turbo-0.1.3-cp311-cp311-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 1c9e3d1f26e0bed97b99b7c35be45e5246cbff608401fd4ccc966d687f17b608
MD5 b577a266f7fd533ae410df39b8c03d68
BLAKE2b-256 1068f6d42a351591b0456303a740c051d4990fa71a164d5da680b31dd40213db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for h3_turbo-0.1.3-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 aa6881fcd6d01fd1d041e1a1a275d4aea3be29b26850f36fafa0320438a5f8db
MD5 869222dab2eff00ecdea9248c798d0cd
BLAKE2b-256 511aaaa5ba4f1096ba129b9789599f0e8ebce9d97e47d36cd3204883904756e9

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