Skip to content

GeoPandas: implement distributed sjoin_nearest #3182

Description

@jiayuasu

Part of #2230.

Implement distributed GeoDataFrame.sjoin_nearest(...) and top-level geopandas.sjoin_nearest(...).

Requirements:

  • Execute through Sedona's distributed K-nearest-neighbor join planning; do not collect geometry rows to the driver, use a Cartesian fallback, or use Python row UDFs.
  • Support inner, left, and right joins with GeoPandas-compatible index and suffix behavior.
  • Return every equidistant nearest match where GeoPandas returns ties.
  • Support max_distance, distance_col, and exclusive.
  • Validate CRS compatibility and preserve the active geometry and CRS for each join mode.
  • Match GeoPandas behavior for empty and null geometries, empty inputs, duplicate and multi-level indexes, overlapping column names, self-joins, and deterministic result ordering where required.

Add focused tests for the optimized Spark plan as well as direct and GeoPandas parity tests covering join modes, ties, distance limits and output, exclusivity, metadata, index shapes, empty/null inputs, and invalid arguments. Add public API documentation for both entry points.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions