Opened 10 years ago

Closed 10 years ago

#3981 closed enhancement (fixed) : add support for output of nodata value

Reported by: etiennesky Owned by: hobu
Priority: normal Milestone: 1.9.0
Component: Utilities Version: svn-trunk
Severity: normal Keywords:


The does not set the nodata value in the bands of the output file.

I have added a -a_nodata option (as in the other tools gdalwarp and gdal_translate), which adds the specified nodata value to the output file (regardless of the -a value).

+ if a_nodata is not None: + t_band.SetNoDataValue?(a_nodata)

Tested on GTIFF files only. I'd be glad to test other files types if necessary.

Attachments (1)

diff-nodata.txt (4.0 KB) - added by etiennesky 10 years ago.
svn diff of file swig/python/scripts/

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by etiennesky

Attachment: diff-nodata.txt added

svn diff of file swig/python/scripts/

comment:1 Changed 10 years ago by Even Rouault

Component: SWIG (all bindings)Utilities
Milestone: 1.9.0
Resolution: fixed
Status: newclosed

I've commited a more compact version of the proposed patch:

r22325 /trunk/gdal/ (apps/gdal_utilities.dox swig/python/scripts/ : add a -a_nodata option (#3981)

Note: See TracTickets for help on using tickets.