jiayuasu opened a new issue, #2799: URL: https://github.com/apache/sedona/issues/2799
## Summary Add `ST_OffsetCurve(geom, distance [, quadrantSegments])` function that returns a line offset by a given distance from a linear geometry. This is the PostGIS equivalent of [`ST_OffsetCurve`](https://postgis.net/docs/ST_OffsetCurve.html). **Parent issue:** #2230 ## Design JTS 1.19+ provides `org.locationtech.jts.operation.buffer.OffsetCurve` which computes an offset curve for a linear geometry. Sedona uses JTS 1.20.0, so this class is available. - Positive distance → offset to the left side - Negative distance → offset to the right side ### Signature ```sql ST_OffsetCurve(geometry lineGeom, double distance) → geometry (LineString) ST_OffsetCurve(geometry lineGeom, double distance, int quadrantSegments) → geometry (LineString) ``` ### Implementation layers 1. **Java core** (`Functions.java`): Wrapper around `new OffsetCurve(geometry, distance).getCurve()`; overload with `quadrantSegments` using `OffsetCurve(geometry, distance, quadSegs).getCurve()` 2. **Scala Expression** (`Functions.scala`): `InferredExpression` case class with multiple overloads 3. **Catalog registration** (`Catalog.scala`) 4. **Scala API** (`st_functions.scala`): Column wrappers 5. **Python API** (`st_functions.py`): Python wrapper 6. **Tests**: Scala + Python ### Example ```sql SELECT ST_OffsetCurve( ST_GeomFromWKT('LINESTRING(0 0, 10 0)'), 5.0 ); -- LINESTRING (0 5, 10 5) ``` ## Edge cases - Non-linear geometries: should handle gracefully (return null or throw) - Zero distance: should return a copy of the input - Empty geometries: return null -- 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]
