jiayuasu opened a new pull request, #3250: URL: https://github.com/apache/sedona/pull/3250
## 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 #2800. Part of #2230. ## What changes were proposed in this PR? This PR adds a PostGIS-compatible `ST_SharedPaths` implementation for lineal geometries. - Implements the shared-path algorithm in the Java common module using robust overlay and spatially indexed source-segment lookup. - Returns a `GeometryCollection` containing: - same-direction shared paths as the first `MultiLineString`; - opposite-direction shared paths as the second `MultiLineString`. - Matches PostGIS behavior for direction, nulls, typed empty geometries, non-lineal input validation, mixed SRIDs, Z preservation, and M removal. - A null operand returns null. - Typed empty inputs or inputs without a shared path return two empty `MultiLineString` components. - Exposes `ST_SharedPaths` through: - Spark SQL and Spark Connect registration; - the Scala DataFrame API; - Python `sedona.spark.sql.st_functions`; - Flink SQL; - Snowflake legacy WKB and native `GEOMETRY` APIs. - Prevents generation of a Snowflake `GEOGRAPHY` overload because this planar lineal operation is supported only for `GEOMETRY`. The native GeoJSON bridge's SRID limitation is documented. - Adds distributed `GeoSeries.shared_paths`, including scalar-geometry handling, positional and index-based alignment, duplicate MultiIndex support, CRS warnings, and GeoDataFrame delegation. - Adds Spark, Flink, and Snowflake API documentation, summary-table entries, and an example diagram. ## How was this patch tested? - Passed all 1,264 tests in the common module, including 14 dedicated `SharedPathsTest` cases. - Passed the Spark 3.4 SQL suite: 236 tests. - Passed the Spark 3.4 DataFrame API suite: 260 tests. - Passed targeted Flink and Snowflake DDL-generation tests. - Passed targeted Python DataFrame API and GeoPandas direct/parity tests. - Verified deterministic direction and ordinate behavior across 520 lineal reference cases, including the large-coordinate near-parallel regression. - Passed Spotless, repository hooks, and `git diff --check`. The credentialed Snowflake integration suites were not run locally. ## Did this PR include necessary documentation updates? - Yes, I am adding a new API and used the current SNAPSHOT version, `v2.0.0`. - Yes, I updated the Spark, Flink, and Snowflake documentation and function summary tables. -- 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]
