jiayuasu opened a new pull request, #2811: URL: https://github.com/apache/sedona/pull/2811
## Summary - Add `ST_OffsetCurve(geom, distance [, quadrantSegments])` function that returns a line offset by a given distance from a linear geometry - Uses JTS `org.locationtech.jts.operation.buffer.OffsetCurve` (available since JTS 1.19, Sedona uses 1.20) - Positive distance offsets to the left, negative to the right - Returns `null` for empty geometries Closes #2799 ## Changes ### Implementation (6 layers) - **Java core** (`Functions.java`): Two overloads — `offsetCurve(Geometry, double)` and `offsetCurve(Geometry, double, int)` using JTS `OffsetCurve` with `BufferParameters` - **Scala Expression** (`Functions.scala`): `ST_OffsetCurve` case class with `inferrableFunction2` and `inferrableFunction3` - **Catalog** (`Catalog.scala`): Function registration - **Scala API** (`st_functions.scala`): Column/String wrappers with optional quadrantSegments - **Python API** (`st_functions.py`): Python wrapper with optional `quadrant_segments` parameter - **Flink** (`Functions.java`, `Catalog.java`): Flink scalar function + registration ### Tests - Java unit tests (5 cases: positive offset, negative offset, zero distance, empty geometry, custom quadrant segments) - Scala SQL tests + DataFrame API tests (with and without quadrantSegments) - SRID preservation test - Python SQL test + DataFrame API tests - Flink tests (2 cases) ### Documentation - SQL, Flink, and Snowflake docs with examples and SVG visual ## Test plan - [x] Java unit tests pass - [x] Python SQL tests pass - [x] Python DataFrame API tests pass - [ ] CI full test suite -- 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]
