[Gdal-dev] gdalwarp and gdal_translate question

Frank Warmerdam warmerdam at pobox.com
Fri Jul 7 21:57:08 EDT 2006


chantain greer wrote:
> Hi,
> I wanted to ask is there a techniqal difference between the way gdalwarp 
> and gdal_translate scales the resolution of a file in pixels.
> 
> gdalwarp uses the -ts option to set output file size in pixels and lines 
> but gdal_translate uses -outsize to set the size of the output file.
> 
> I wanted to find out if the output file would be the same if you used 
> either technique.

Chantain,

In theory gdalwarp with the nearest neighbour resampling (the default)
should give similar results to gdal_translate when doing downsampling.
In practice there might be an "off by one" issue that would result in
picking different pixels for the downsampling.  Basically gdalwarp
tries to be very precise about all the sampling while gdal_translate
tries to be fast and a bit careless of the details when changing
resolution.

Note that only gdalwarp includes other resampling kernels like
bilinear and bicubic.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list