[gdal-dev] gdal_translate resampling introduces bias, gdalwarp does not

Mike A m.g.aschenbeck at gmail.com
Wed Oct 28 09:35:02 PDT 2020


Greetings.

I have noticed a difference in gdal_translate vs gdalwarp.  gdal_translate
introduces a slight bias when it resamples.  This seems to be reproducible
when coarsening resolutions by roughly 5-10 percent.

For my specific example, I'm starting with a .5m x .5m UTM image.  I've
seen this in GDAL 2.41 and 3.1.4.  I perform the following calls:
  gdal_translate -r cubic -tr .53 .53 src.tif src_TRANSLATE.tif
  gdalwarp -r cubic -tr .53 .53 src.tif src_WARP.tif
It's hard to quantify the amount of shift, but I would approximate it to be
about a third of a pixel.

I believe gdalwarp is more rigorous than gdal_translate.  However, I
wouldn't expect a visible shift with the latter.  The question is, is this
expected behavior or a bug?

I have some animated gif's illustrating the problem.  These will obviously
go away after some time.
gdal_translate src.tif vs src_TRANSLATE:
https://drive.google.com/file/d/1XeWafUlUzN6somcyUL2dfyvlwS3IOpRP/view?usp=sharing
gdalwarp src.tif vs src_WARP:
https://drive.google.com/file/d/1Zv5ypaRzCEZzVUmfGf01UtTTVoPD7ADL/view?usp=sharing

Thanks in advance,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20201028/85289bb9/attachment.html>


More information about the gdal-dev mailing list