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

Even Rouault even.rouault at spatialys.com
Mon Oct 30 13:37:52 PDT 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171030/b9efc6dc/attachment-0001.html>


More information about the gdal-dev mailing list