Repository navigation
Closed as not planned
Description
Part of #2230.
Summary
Implement the closely related GeoJSON interface methods that are currently missing from Sedona's GeoPandas-compatible API:
GeoDataFrame.iterfeaturesGeoDataFrame.to_geo_dictGeoDataFrame.__geo_interface__GeoSeries.__geo_interface__
These methods should follow GeoPandas behavior while using Sedona's existing to_geopandas() materialization boundary. As with the current to_json, to_arrow, and plot implementations, this functionality will collect data to the driver and should be documented accordingly.
Requirements
- Support
iterfeatures(na="null", show_bbox=False, drop_id=False)argument semantics. - Return GeoPandas-compatible feature dictionaries, identifiers, bounding boxes, and null handling.
- Keep
to_geo_dictand both__geo_interface__properties consistent withiterfeatures. - Preserve index values in feature identifiers unless
drop_id=True. - Handle null geometries, empty geometries, mixed geometry types, and CRS-bearing inputs.
- Add no new mandatory dependency.
Version compatibility
The Python 3.8 environment resolves GeoPandas 0.13.2, which does not provide GeoDataFrame.to_geo_dict. The implementation should supply a behavior-compatible fallback instead of skipping this API on Python 3.8. Newer environments should match their installed GeoPandas behavior.
Tests
Add direct and parity coverage for:
- default, named, and non-string indexes;
drop_id=Trueanddrop_id=False;show_bbox=Trueandshow_bbox=False;na="null",na="drop", andna="keep";- null and empty geometries;
- mixed geometry types;
- CRS-bearing GeoDataFrames;
- GeoDataFrame and GeoSeries
__geo_interface__output; - the GeoPandas 0.13.2 fallback path.
Likely files
python/sedona/spark/geopandas/geodataframe.pypython/sedona/spark/geopandas/geoseries.pypython/tests/geopandas/test_geodataframe.pypython/tests/geopandas/test_match_geopandas_dataframe.pypython/tests/geopandas/test_geoseries.pypython/tests/geopandas/test_match_geopandas_series.py
Acceptance criteria
- All four APIs are implemented and documented.
- Supported arguments and edge cases match GeoPandas behavior.
- Python 3.8 with GeoPandas 0.13.2 remains supported.
- Focused tests and the relevant Python matrix pass.
- The implementation PR references
Part of #2230and does not close the epic.
Non-goals
- A distributed or streaming GeoJSON iterator.
- Changes to JVM or SQL geometry functions.
- Implementing
to_file,clip,overlay, or other unrelated GeoPandas APIs.
Metadata
Metadata
Assignees
Labels
No labels
Activity
jiayuasu commentedon Jul 21, 2026
Closing because these APIs return or iterate Python feature objects on the driver. Implementing them through
to_geopandas()would collect the dataset and conflict with Sedona’s distributed-execution goals. We can revisit this only if a scalable distributed contract becomes available.