[gdal-dev] Re: Strange behavior of gdalwarp with -overwrite option

Kyle Shannon KShannon at gcs-research.com
Wed Nov 9 10:45:09 EST 2011


It seems to me the result of the command:

gdalwarp -t_srs EPSG:4326 -overwrite mosaic.tif mosaic.tif

would never be desired, and maybe not allowed?  Is there any case where this makes any sense?

-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Even Rouault
Sent: Wednesday, November 09, 2011 4:55 AM
To: Hermann Peifer
Cc: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Re: Strange behavior of gdalwarp with -overwrite option

Selon Hermann Peifer <peifer at gmx.eu>:

> On 08/11/2011 20:28, Even Rouault wrote:
> >
> > gdalwarp something.tif something.tif -t_srs EPSG:XXXX makes no sense...
>
> Indeed: typing 'something.tif' twice should not be necessary. But the 
> following could theoretically make sense (in analogy to GNU sed's 
> -i/--in-place switch (which creates a temporary file and later
> *overwrites* the original file):
>
> gdalwarp -i something.tif -t_srs EPSG:XXXX
>
> However, as one hardly get things right in the first run: there is a 
> good chance that the result is not what you want -- and the original 
> file is gone :-(. At least this happens to me whenever I use sed's -i 
> switch. So I wouldn't see a need for introducing this behaviour in 
> GDAL command line utilitiies.

There's no risk to see that in the case of gdalwarp. GDAL has no infrastructure to do in place reprojection and it would be really challenging to do that without a temporary file.

>
> Hermann
>


_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list