[gdal-dev] gdalwarp into an existing destination from python

Olivier Dalang olivier.dalang at gmail.com
Wed Nov 27 09:51:03 PST 2019


Dear list,

When I use gdalwarp from command line and set output to an existing file,
the contents get mosaic-ed in the existing file (as expected and
documented).

$> gdalwarp -cutline cutline.shp source.tif dest.tif

But when doing the from python, the existing destination file get
overwritten.

gdal.Warp("dest.tif", "source.tif", cutlineDSName="cutline.shp")

Is there a flag or something to achieve same behaviour as command line ? I
looked carefully in the python api doc, but couldn't find it...

Cheers !!

Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191127/448c4f7e/attachment.html>


More information about the gdal-dev mailing list