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

2019-11-27 Thread Olivier Dalang
Awesome, that's what I was looking for :-) Thanks !!! Olivier On Wed, 27 Nov 2019 at 20:28, Even Rouault wrote: > Olivier, > > > 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... > > Not exacly a fla

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

2019-11-27 Thread Even Rouault
Olivier, > 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... Not exacly a flag, but: destDS = gdal.Open("dest.tif", gdal.GA_Update) gdal.Warp(destDS, "source.tif", cutlineDSName="cutline.shp") Cheers, Ev

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

2019-11-27 Thread Olivier Dalang
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.