jiayuasu opened a new pull request, #2707: URL: https://github.com/apache/sedona/pull/2707
## 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 #2702 ## What changes were proposed in this PR? `ST_LineMerge` returns `GEOMETRYCOLLECTION EMPTY` for `LineString` input instead of passing it through unchanged. This is inconsistent with PostGIS/GEOS behavior, where a single `LineString` is already "merged" and should be returned as-is. **Fix:** Added a `LineString` instanceof check in `Functions.lineMerge()` before the `MultiLineString` block, so that a single `LineString` is returned unchanged. ```java if (geometry instanceof LineString) { return geometry; } ``` **Behavior after fix:** | Input type | Result | |---|---| | `LineString` | Returned unchanged (was: `GEOMETRYCOLLECTION EMPTY`) | | `LineString` | Returned unchanch| `LineString` | Retur (Point, Polygon, | `LineString` | Returned unchanch| `LineString` | Retur (Point, Polygon, | `LineString` | Returned unchanch| `LineString` | Retur (Point, Polygon, | `LineString` | Returned unchan test case to the existing `ST_LineMerg| `LineString` | Returned unchanch| `LineString` | Retur (Point, Polygon, | G (| `LineString` | Returned unchanch| `LinN EMPTY`. All 223 tests in `functionTestScala` pass locally. No regressions. ## Did this PR include necessary documentation updates? - No, this PR does not affect any public API so no need to change the documentation. -- 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]
