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:28:03 UTC
[I] ST_GeomFromWKT drops an all-NaN Z dimension, and ST_GeomFromWKB reads POINT (NaN 1) as empty [sedona]
jiayuasu opened a new issue, #3486:
URL: https://github.com/apache/sedona/issues/3486
Two readers lose information that GEOS and PostGIS keep.
**WKT.** `ST_GeomFromWKT` and the other WKT constructors parse with JTS's `WKTReader`, which builds the same coordinate sequences for `POINT (1 2)` and `POINT Z (1 2 NaN)`. When every Z value is NaN, the Z dimension is lost by the time the geometry is stored:
```sql
SELECT ST_NDims(ST_GeomFromWKT('POINT Z (1 2 NaN)')) -- 2
SELECT ST_EqualsIdentical(ST_GeomFromWKT('POINT (1 2)'), ST_GeomFromWKT('POINT Z (1 2 NaN)')) -- true
```
The same happens to `POINT Z EMPTY`, to an all-NaN Z in line strings, polygons and multipoints, and to the Z of `POINT ZM (1 2 NaN NaN)`. `ST_GeomFromWKB` already keeps these layouts, so the same geometry read from WKB and from WKT is not identical.
**WKB.** `ST_GeomFromWKB` reads a point as empty when either X or Y is NaN, so `POINT (NaN 1)` becomes `POINT EMPTY`. WKB encodes an empty point as `POINT (NaN NaN)`; a point with one NaN ordinate should keep its ordinates.
Both readers come from `org.datasyslab:jts-io-patch`; `1.21.0-datasyslab-3` adds a WKT reader that keeps tagged layouts and fixes the WKB empty-point rule.
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ST_GeomFromWKT drops an all-NaN Z dimension, and ST_GeomFromWKB reads POINT (NaN 1) as empty [sedona]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu closed issue #3486: ST_GeomFromWKT drops an all-NaN Z dimension, and ST_GeomFromWKB reads POINT (NaN 1) as empty
URL: https://github.com/apache/sedona/issues/3486
--
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