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

Even Rouault even.rouault at mines-paris.org
Wed Nov 9 11:09:17 EST 2011


Selon Kyle Shannon <KShannon at gcs-research.com>:

> 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?

As I said in my previous email, I can't see any case where it would be valid.
With -overwrite, it is suicide. Without -overwrite, it is useless at best. So in
my opinion, this should not be allowed

>
> -----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