[gdal-dev] Gdalwarp -crop_to_cutline results in shifted raster

Marius Jigmond mariusjigmond at hotmail.com
Mon Jan 31 21:42:17 EST 2011


Hi Everyone,

I am using the -crop_to_cutline option of gdalwarp but the resulting
raster is slightly shifted. Both cutline shapefile and raster are using
the same projection. On the sample raster dataset (pixel=28.5m) the
shift is about 5m to the east and 3.5m to the north. Pixel values remain
the same (so resampling doesn't take place, as expected).

I should add that not adding -crop_to_cutline results in no shift.
Commands I ran:
(1) gdalwarp -cutline mask.shp -crop_to_cutline sample.tif cropped.tif
result is shifted

(2) gdalwarp -cutline mask.shp sample.tif out.tif
result is not shifted

A workaround would be using gdal_rasterize on after option (2) above.

-marius



More information about the gdal-dev mailing list