[gdal-dev] Deviation with gdalwarp

Pedro Venâncio pedrongvenancio at gmail.com
Mon Oct 5 15:37:41 PDT 2015


Hi all,

I have a raster file (ascii) created through an IDW interpolation, with
spatial resolution of 12.5m. I'm using gdalwarp to clip the raster with a
polygon mask. I use the parameter "-tr 12.5 12.5" to keep the original
resolution.

However, the clipped raster is not with the pixels aligned to the original
raster pixels. It's like being moved slightly to one side (a distance less
than the size of a pixel).

Making the cut with Clip grid with polygon of SAGA GIS, the resulting
raster pixels keeps perfectly aligned to the original raster.

How can this deviation be explained with gdalwarp? In this case I have not
used any resampling or coordinate transformation, I just made the clip,
with the command:
gdalwarp -tr 12.5 12.5 -q -cutline D:\Testes\concelho.shp -crop_to_cutline
-of GTiff D:\Testes\idw.asc D:\Testes\idw_clip_gdalwarp.tif

I leave my tests data so you can see the shift that I'm talking about:

https://cld.pt/dl/download/2af4cb16-319f-4b43-988a-a529a9dc9806/Testes.zip

I'm using GDAL 1.11.2.

Thank you very much!

Best regards,
Pedro Venâncio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151005/f86e2f57/attachment.html>


More information about the gdal-dev mailing list