[gdal-dev] gdalwarp + cutline and change extent

Even Rouault even.rouault at spatialys.com
Fri Jun 3 02:26:19 PDT 2016


Le vendredi 03 juin 2016 09:12:25, Paul Meems a écrit :
> Hi,
> 
> Currently we're using GDAL v1.10
> We need to clip a piece out of a larger tiff file using a shapefile.
> 
> When we use this command:
> gdalwarp -cutline Field9.shp -crop_to_cutline -wo
> "CUTLINE_ALL_TOUCHED=TRUE" input.tif output.tif
> We get a nicely cropped tiff-file like we want. But the pixels have shifted
> towards the cutline making the input and output tiff files no longer align.
> 
> When we use the command without -crop_to_cutline:
> gdalwarp -cutline Field9.shp -wo "CUTLINE_ALL_TOUCHED=TRUE" input.tif
> output.tif
> We get a cut tiff-file which aligns correctly with the pixels of the input
> file but all pixels outside the the cutline are set to nodata and the
> extent of the output file is the same as the input file.
> 
> What is the correct command to keep the pixels aligned AND crop the extent
> of the output file.

See https://trac.osgeo.org/gdal/ticket/3947

> 
> Thanks,
> 
> Paul

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


More information about the gdal-dev mailing list