Opened 13 years ago

Closed 13 years ago

#3981 closed enhancement (fixed)

gdal_merge.py : 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:
Cc:

Description

The gdal_merge.py 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 13 years ago.
svn diff of file swig/python/scripts/gdal_merge.py

Download all attachments as: .zip

Change History (2)

by etiennesky, 13 years ago

Attachment: diff-nodata.txt added

svn diff of file swig/python/scripts/gdal_merge.py

comment:1 by Even Rouault, 13 years ago

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/gdal_merge.py): gdal_merge.py : add a -a_nodata option (#3981)

Note: See TracTickets for help on using tickets.