[gdal-dev] Deviation with gdalwarp

Even Rouault even.rouault at spatialys.com
Tue Oct 6 00:32:00 PDT 2015


Le mardi 06 octobre 2015 00:37:41, Pedro Venâncio a écrit :
> 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

Pedro,

This a known behaviour of gdalwarp. See 
https://trac.osgeo.org/gdal/ticket/4344

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list