jiayuasu opened a new pull request, #2806:
URL: https://github.com/apache/sedona/pull/2806

   ## Summary
   
   - Add `ST_ShortestLine(geom1, geom2)` function that returns the shortest 
LineString connecting two geometries
   - Uses JTS `DistanceOp.nearestPoints()` internally — same approach as the 
existing `ST_ClosestPoint` but returns both endpoints as a LineString instead 
of a single Point
   - Returns `null` for empty geometries
   
   Closes #2798
   
   ## Changes
   
   ### Implementation (6 layers)
   - **Java core** (`Functions.java`): `shortestLine(Geometry, Geometry)` using 
`DistanceOp`
   - **Scala Expression** (`Functions.scala`): `ST_ShortestLine` case class
   - **Catalog** (`Catalog.scala`): Function registration
   - **Scala API** (`st_functions.scala`): Column/String wrappers
   - **Python API** (`st_functions.py`): Python wrapper
   - **Flink** (`Functions.java`, `Catalog.java`): Flink scalar function + 
registration
   
   ### Tests
   - Java unit tests (5 cases: point-to-point, point-to-linestring, 
polygon-to-polygon, empty geometry, same geometry)
   - Scala SQL tests + DataFrame API test
   - SRID preservation test
   - Python SQL test + DataFrame API test
   - Flink test
   
   ### Documentation
   - SQL, Flink, and Snowflake docs with examples
   
   ## Test plan
   
   - [x] Java unit tests pass (`mvn test -pl common 
-Dtest="FunctionsTest#shortestLine*"`)
   - [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]

Reply via email to