Hi,

good question. To the best of my knowledge, in the official WKT / WKB spec, it is a "everything or nothing" logic. Either all the vertices have a well defined Z value and then you use LINESTRING Z, POLYGON Z, etc.. Or none of them have, and you use the 2D versions: LINESTRING, POLYGON, etc.

I believe QGIS has standardized using not-a-number NaN number for that purpose, but officially, you can't export that to WKT... That said, for the sake of interoperability with QGIS or other software using NaN, the OGR WKT importer and exporter also supports its:

$ python -c "from osgeo import ogr; g = ogr.CreateGeometryFromWkt('POINT Z (1 2 nan)'); print(g.ExportToIsoWkt())"
POINT Z (1 2 nan)

but I'm not sure if I'd recommend using that convention. I can imagine exporting NaN to some formats could produce invalid content.

The good old shapefile uses a similar convention to the -1e300 trick you propose. https://www.esri.com/content/dam/esrisites/sitecore-archive/Files/Pdfs/library/whitepapers/pdfs/shapefile.pdf , page 2 : "Any floating point number smaller than –10^38 is considered by a shapefile reader to represent a "no data" value"

Even

Le 25/01/2024 à 18:07, Abel Pau via gdal-dev a écrit :

Hi,

there is any value in GDAL for VECTORS that indicates that a concrete value of a Z is not known (z nodata value)?

I couldn’t find it anywhere.

In MiraMon format we use one concrete number documented in our format pdf (-1.0E+300) an in the driver it’s planned to translate it to the same number. I could translate it to the one I am asking. And the same for detecting nodata Z and translate them to -1.0E+300 when reading another format.

Thanks!

*Abel Pau Garcia*

*GIS developer*

        

https://www.creaf.cat/sites/default/files/creaf-signature.png

*a....@creaf.uab.cat* <mailto:a....@creaf.uab.cat>

*Let's chat on Teams!* <https://teams.microsoft.com/l/chat/0/0?users=a....@creaf.uab.cat>

*Tel. +34 934814277*

        

https://www.creaf.cat/sites/default/files/so-en-signature.png

https://www.creaf.cat/sites/default/files/twitter-icon-signature.png <https://twitter.com/CREAF_ecologia>https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png <https://www.linkedin.com/company/1363052?trk=tyah&trkInfo=clickedVertical:company,clickedEntityId:1363052,idx:2-1-2,tarId:1465807877789,tas:creaf>https://www.creaf.cat/sites/default/files/youtube-icon-signature.png <https://www.youtube.com/c/creafecologia>https://www.creaf.cat/sites/default/files/instagram-icon-signature.png <https://www.instagram.com/CREAF_ecologia/>

*www.creaf.cat* <http://www.creaf.cat>*| **http://blog.creaf.cat* <http://blog.creaf.cat>

        

https://www.creaf.cat/sites/default/files/uab_logo_signatura.png

CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)


Before printing this electronic message, think about the environment.

http://www.creaf.uab.cat/_signatura/line.gif


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to