--- id: h3-pyspark version: "1.2.6" license: unclear license_treatment: permissive maintenance: dormant --- # h3-pyspark — PySpark bindings for H3, a hierarchical hexagonal geospatial indexing system License: permissive · Maintenance: dormant · Downloads: 225.6K/mo ## What it is and what it does h3-pyspark wraps Uber's H3 hierarchical hexagonal indexing system for use in PySpark DataFrames, enabling you to convert latitude/longitude coordinates into H3 cell identifiers and index complex geometries (points, polygons, multipolygons) as sets of H3 cells at a chosen resolution. It extends the vanilla H3 library with PySpark-native operations for spatial indexing, k-ring buffering, and spatial joins—allowing you to bucket and cluster geometries efficiently across a distributed cluster. The package assumes GeoJSON representation of geometries and H3 cells as string columns, making it a natural fit for pipelines that already work with GeoJSON. It is most useful for approximate spatial joins and distance-based bucketing, though results are candidates rather than exact matches and should be validated with a secondary distance check if precision is required. Use it for: - Index geographic features (buildings, roads, regions) into H3 cells for distributed spatial bucketing and clustering. - Perform approximate spatial joins between two large datasets by indexing both on H3 and joining on cell identity. - Generate buffered spatial indexes around geometries using k-ring operations for distance-based queries. - Organize geospatial data into hierarchical hexagonal grids for efficient map visualization and aggregation. - Implement distance joins by combining H3 indexing with secondary distance validation using a UDF. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides PySpark bindings for H3, enabling hexagonal geospatial indexing operations on distributed DataFrames—converting coordinates to H3 cells, indexing geometries, and performing spatial joins at scale. Yes, if you are already using PySpark and need distributed H3 indexing—it has no runtime dependencies, low install friction, and a permissive license. However, be aware that the package is dormant; verify compatibility with your PySpark and H3 versions before committing to production. No known security vulnerabilities. ## Install pip install h3-pyspark uv add h3-pyspark poetry add h3-pyspark ## Installing h3-pyspark Before you install: Low friction installation as a pure-Python wheel. Maintenance is dormant—last release was 2022-03-10, with no updates since, though the repository remains active and unarchived. No runtime dependencies to manage. License in practice: Licensed under MIT (permissive), allowing use in proprietary and open-source projects without significant restrictions. Quickstart: pip install h3-pyspark from pyspark.sql import SparkSession, functions as F import h3_pyspark spark = SparkSession.builder.getOrCreate() df = spark.createDataFrame([{"lat": 37.769377, "lng": -122.388903, "resolution": 9}]) df = df.withColumn('h3_9', h3_pyspark.geo_to_h3('lat', 'lng', 'resolution')) df.show() Requires PySpark to be installed and a running Spark environment; requires Python >=3.6. Verify before relying: - Whether the package works with recent PySpark versions (last release predates significant Spark API changes). - Compatibility with modern H3 core library versions and whether h3-py dependency is pinned or flexible. - Performance characteristics on large-scale distributed workloads compared to native Spark geospatial functions. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 225.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pyspark geospatial indexing, h3 hexagonal grid spark, distributed spatial joins, h3 cells pyspark, geospatial bucketing spark, coordinate to h3 cell, spatial index distributed, geospatial, distributed-computing [View on SkillFed](https://skillfed.io/packages/h3-pyspark) · [View on PyPI](https://pypi.org/project/h3-pyspark/)