You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/10/19 16:30:22 UTC
[PR] [GH-3486] Keep the Z or M dimension of WKT tagged Z, M or ZM even when its values are all NaN [sedona]
jiayuasu opened a new pull request, #3487:
URL: https://github.com/apache/sedona/pull/3487
## 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 #3486
## What changes were proposed in this PR?
- Bump `org.datasyslab:jts-io-patch` to `1.21.0-datasyslab-3`. It adds `WKTReader.forDeclaredDimensions()`, the WKT counterpart of the `WKBReader.forDeclaredDimensions()` that Sedona already uses, and its `WKBReader` reads a point as empty only when X and Y are both NaN.
- `Constructors.geomFromWKT`, `geomFromEWKT`, `mPointFromText`, `mLineFromText`, `mPolyFromText` and `geomCollFromText`, and the WKT reader in `FormatUtils`, use `WKTReader.forDeclaredDimensions()`.
Effect:
- WKT tagged `Z`, `M` or `ZM` keeps that layout when its values are all NaN or the geometry is empty: `POINT Z (1 2 NaN)` and `POINT Z EMPTY` are stored as XYZ, and `POINT ZM (1 2 NaN NaN)` as XYZM. So `ST_EqualsIdentical(ST_GeomFromWKT('POINT (1 2)'), ST_GeomFromWKT('POINT Z (1 2 NaN)'))` is false, as in GEOS, and a WKT geometry is identical to the same geometry read from WKB.
- Untagged WKT is read as before, including the old JTS syntax: `POINT (1 2 3)` is still XYZ and `POINT (1 2)` still XY.
- `ST_GeomFromWKB` reads `POINT (NaN 1)` as a point with a NaN X instead of `POINT EMPTY`. `POINT (NaN NaN)` is still empty.
This changes the output of the WKT constructors for tagged all-NaN input, which used to be stored as 2D.
## How was this patch tested?
- New `ConstructorsTest` cases: the stored layout of tagged XYZ, XYM and XYZM points, lines, polygons, multipoints and empties, before and after a serializer round trip; untagged and old-syntax input unchanged; EWKT with an SRID; and `POINT (NaN 1)` versus `POINT (NaN NaN)` from WKB. New `PredicatesTest` case for `ST_EqualsIdentical` on tagged all-NaN WKT. These fail on `master` with `1.21.0-datasyslab-2`.
- `common`: 1,446 tests pass. Before rebasing: `constructorTestScala`, `predicateTestScala`, `functionTestScala`, `dataFrameAPITestScala` and `GeoParquetDimensionsSuite` (601 passed; the one failure is a MySQL test that needs Docker) and Flink `ConstructorTest`, `PredicateTest`, `FunctionTest` (274 passed), with the published `1.21.0-datasyslab-3`.
## Did this PR include necessary documentation updates?
- No, this PR does not add or change a public API. The constructors' documented behavior is unchanged; tagged WKT now keeps the dimension it declares.
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-3486] Keep the Z or M dimension of WKT tagged Z, M or ZM even when its values are all NaN [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #3487:
URL: https://github.com/apache/sedona/pull/3487
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org