Summary
GeoPandas exposes GeoSeries.hilbert_distance and the corresponding GeoDataFrame active-geometry method for generating one-dimensional spatial-ordering keys from geometry-envelope midpoints. Sedona does not currently provide this API or a native SQL primitive with matching semantics.
Proposed changes
- Add a native
ST_HilbertDistance scalar function backed by JTS, returning the full unsigned 32-bit address range as Long.
- Expose the function in Spark, Flink, Snowflake
GEOMETRY, and Snowflake GEOGRAPHY APIs.
- Implement distributed
GeoSeries.hilbert_distance(total_bounds=None, level=16) and GeoDataFrame delegation.
- Infer default midpoint bounds with one distributed metadata aggregation while keeping all per-row results distributed.
- Preserve GeoPandas index/name behavior and document Spark's signed
int64 representation.
- Add cross-engine, parity, edge-case, and execution-plan tests plus SQL and GeoPandas documentation.
No geometry rows should be collected on the driver and no Python UDF should be introduced.
Part of #2230.
Summary
GeoPandas exposes
GeoSeries.hilbert_distanceand the corresponding GeoDataFrame active-geometry method for generating one-dimensional spatial-ordering keys from geometry-envelope midpoints. Sedona does not currently provide this API or a native SQL primitive with matching semantics.Proposed changes
ST_HilbertDistancescalar function backed by JTS, returning the full unsigned 32-bit address range asLong.GEOMETRY, and SnowflakeGEOGRAPHYAPIs.GeoSeries.hilbert_distance(total_bounds=None, level=16)and GeoDataFrame delegation.int64representation.No geometry rows should be collected on the driver and no Python UDF should be introduced.
Part of #2230.