[gdal-dev] NODATA values in diferents bands in a DataSet
Even Rouault
even.rouault at spatialys.com
Wed May 21 07:55:35 PDT 2025
Abel,
there is a subtelty:
a) If bands may have invalid pixels at different locations on different
bands, and that those bands have a different nodata value, then using
GDALRasterBand::SetNoDataValue() is the way to go.
b) If a given pixel is invalid only if its value on all bands matches
the nodata value on each band, then NODATA_VALUES should be set instead
Example with 2 bands:
- Band 1, NoData=1, pixel_1=1, pixel_2=1
- Band 2, NoData=2, pixel_1=2, pixel_2=0
In interpretation a), then pixel_1 and pixel_2 are invalid for Band 1,
and pixel_1 is invalid for Band 2
In interpretation b), then only pixel_1 is invalid (for both bands)
Le 21/05/2025 à 08:46, Abel Pau via gdal-dev a écrit :
> Hello,
> I am implementing a driver that allows different NODATA values for
> each band in a dataset.
> >From what I understand in the documentation, I should use the
> |NODATA_VALUES| metadata item to document these values. However, I
> don't see a clear way to indicate that a specific band has *no
> NODATA* value within the tuple.
> On the other hand, the documentation also suggests that
> |NODATA_VALUES| is *not widely honoured*, which is not very encouraging.
> Therefore, would you consider it good practice to separate bands with
> different NODATA values into separate *sub*datasets instead?
> Thank you very much for the clarification.
>
> *Abel Pau Garcia
> <https://www.creaf.cat/en/about-us/our-people/abel-pau-garcia>*<https://www.creaf.cat/en/about-us/our-people/abel-pau-garcia>
>
> <https://www.creaf.cat/>
> *MiraMon Technical Lead
> <https://www.creaf.cat/en/about-us/our-people/abel-pau-garcia>*
> *a.pau at creaf.cat <mailto:a.pau at creaf.cat>*<mailto:a.pau at creaf.cat>
>
> *Let's chat on Teams!
> <https://teams.microsoft.com/l/chat/0/0?users=a.pau@creaf.cat>*<https://teams.microsoft.com/l/chat/0/0?users=a.pau@creaf.cat>
> *Tel. +34 <#>*
>
> <https://twitter.com/CREAF_ecologia><https://www.linkedin.com/company/creaf/><https://www.youtube.com/c/creafecologia><https://www.instagram.com/CREAF_ecologia/>
> *www.creaf.cat <http://www.creaf.cat>*<http://www.creaf.cat>* |
> **Latest news
> <https://www.creaf.cat/en/news-and-agenda/news>*<https://www.creaf.cat/en/news-and-agenda/news>
> CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)
> <https://www.openstreetmap.org/way/123379060>
>
> *Privacy policy
> <https://www.creaf.cat/privacy-policy>*<https://www.creaf.cat/privacy-policy>
>
> Before printing this electronic message, think about the environment. <#>
>
>
>
> _______________________________________________
> 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/20250521/c2adc6a4/attachment-0001.htm>
More information about the gdal-dev
mailing list