jiayuasu opened a new pull request, #2828: URL: https://github.com/apache/sedona/pull/2828
## Did you read the Contributor Guide? - Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/) ## Is this PR related to a ticket? - Yes, and the PR name follows the format `[GH-XXX] my subject`. Closes #2230 (partial) ## What changes were proposed in this PR? Implement GeoPandas counterparts for `ST_ShortestLine` and `ST_OffsetCurve`: - **`GeoSeries.shortest_line(other, align=None)`**: binary operation returning the shortest line between two geometries, delegating to `ST_ShortestLine`. Supports GeoSeries-to-GeoSeries and GeoSeries-to-single-geometry operations. - **`GeoSeries.offset_curve(distance, quad_segs=8, join_style="round", mitre_limit=5.0)`**: unary operation returning a line at a given offset distance from a linear geometry, delegating to `ST_OffsetCurve`. Handles empty geometries by returning `LINESTRING EMPTY` to match GeoPandas behavior (Sedona's `ST_OffsetCurve` returns null for empty inputs). Both functions are implemented in `geoseries.py` (actual logic) and `base.py` (docstrings + delegation), following the existing patterns for binary and unary operations respectively. ## How was this patch tested? - Added tests in `test_geoseries.py` for both functions, covering GeoSeries-vs-GeoSeries, GeoSeries-vs-single-geometry, and GeoDataFrame delegation. - Added tests in `test_match_geopandas_series.py` for both functions, comparing Sedona GeoSeries output against native GeoPandas output across all geometry types. ## Did this PR include necessary documentation updates? - No, this PR does not affect any public API so no need to change the documentation. Docstrings are included in the `base.py` implementations. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
