[gdal-dev] vector NODATA for Z values?

Even Rouault even.rouault at spatialys.com
Thu Jan 25 09:23:15 PST 2024


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.pau at creaf.uab.cat* <mailto:a.pau at creaf.uab.cat>
>
> *Let's chat on Teams!* 
> <https://teams.microsoft.com/l/chat/0/0?users=a.pau@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 at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3657 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 2547 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 505 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 446 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 553 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 582 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.jpg
Type: image/jpeg
Size: 2208 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.jpg
Type: image/jpeg
Size: 1111 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240125/a4b773dc/attachment-0003.jpg>


More information about the gdal-dev mailing list