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

Marius Jigmond mariusjigmond at hotmail.com
Tue Feb 1 13:40:03 EST 2011


Submitted as ticket# 3947 but I had to link the sample data because of size.
-marius

Date: Tue, 1 Feb 2011 19:00:13 +0530
Subject: Re: [gdal-dev] Gdalwarp -crop_to_cutline results in shifted raster
From: chaitanya.ch at gmail.com
To: mariusjigmond at hotmail.com
CC: gdal-dev at lists.osgeo.org

Marius,

Can you provide some sample data to investigate this? You can raise a ticket at http://trac.osgeo.org/gdal/newticket and attach the data.


On Tue, Feb 1, 2011 at 8:12 AM, Marius Jigmond <mariusjigmond at hotmail.com> wrote:

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



_______________________________________________

gdal-dev mailing list

gdal-dev at lists.osgeo.org

http://lists.osgeo.org/mailman/listinfo/gdal-dev



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/ 
+91-9494447584
17.2416N 80.1426E
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110201/3faed27e/attachment.html


More information about the gdal-dev mailing list