[gdal-dev] write nodata value using using creation option

Even Rouault even.rouault at spatialys.com
Tue Oct 31 04:10:02 PDT 2017


On mardi 31 octobre 2017 09:11:14 CET Rashad Kanavath wrote:
> Thanks Jukka and Even for you reply.
> 
> I am using otb to write gtiff image and using ExtendedFilename option in
> otb, it allows me to pass creation options to gdal.
> So for now, I write the image in otb without any extended filename stuff
> and then add no_data by using GDALSetNoDataValue() in python.
> In  my python code, I can also call gdal_translate to do this via
> subprocess.call()
>  but I was wondering if passing nodata value as creation option would be
> possible?

Almost everything is possible in theory, but I don't feel we need that redundancy. 
Why couldn't otb extendedFilename mechanisme be extended to support setting nodata through GDALSetNoDataValue(),
with a gdal:nodata=value syntax ?

You don't need to use subprocess.call() to use gdal_translate functionnality.
See 
https://trac.osgeo.org/gdal/browser/trunk/autotest/utilities/test_gdal_translate_lib.py#L249

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171031/4aa71120/attachment.html>


More information about the gdal-dev mailing list