[gdal-dev] write nodata value using using creation option
Rashad Kanavath
mohammedrashadkm at gmail.com
Tue Oct 31 01:11:14 PDT 2017
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?
[1] https://wiki.orfeo-toolbox.org/index.php/ExtendedFileName
On Mon, Oct 30, 2017 at 9:37 PM, Even Rouault <even.rouault at spatialys.com>
wrote:
> On lundi 30 octobre 2017 16:16:12 CET Rashad Kanavath wrote:
>
> > Hello,
>
> >
>
> > Is it possible to set nodata using -co option.?
>
> >
>
> > gdal_translate input.tif output.tif -co TIFFTAG_GDAL_NODATA=-30000
>
> > Input file size is 500, 500
>
> > Warning 6: driver GTiff does not support creation option
> TIFFTAG_GDAL_NODATA
>
> > 0...10...20...30...40...50...60...70...80...90...100 - done.
>
> >
>
> > According to doc, TIFFTAG_GDAL_NODATA is an tag available if GeoTIFF
>
> > profile is GDALGeoTIFF. and by default the profile is exactly that. I
>
> > cross checked this with sources.
>
> >
>
> > using -a_nodata is working. But I would like to see if I can pass nodata
>
> > value via creation options. This is because in my workflow I am not using
>
> > gdal_translate utility.
>
>
>
> You can use the GDALSetNoDataValue() API, or its declinations in the
> language you use.
>
>
>
> --
>
> Spatialys - Geospatial professional services
>
> http://www.spatialys.com
>
--
Regards,
Rashad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171031/becbcde7/attachment.html>
More information about the gdal-dev
mailing list