[gdal-dev] Question about using crop_to_cutline

Joaquim Luis jluis at ualg.pt
Thu Oct 25 06:47:12 PDT 2012


I have a close functionality in Mirone but it was developed mainly for 
grids, though it works also with images.
With a grid/image loaded, load the polygon too. Next right-click on the 
polygon line and select

ROI Crop Tools -> Crop Image         (or any of the other related options)

and it's done. One thing you may not like is that the resulting image is 
not of the same size (extent) as the original. This is so because I 
(don't remember anymore why) decided to save only the extent 
corresponding to the BoundingBox of the polygon.

Joaquim

> Hi
> I have exacly the same problem. It is resampling to the extent of the 
> polygon instead of croping just the pixels inside the polygon and 
> using the pixel frame of the original image. How can this be fixed?
> Regards
> Luis Lisboa
> --------- ORIGINAL MESSAGE------------------------------
> Greetings
>
> I have a raster image and a shapefile polygon and I wanted to crop the
> raster for just to have valid pixels inside the polygon. I have used
> crop_to_cutline but here is a problem:
> It produces a raster map but pixels does not geographically match with
> the original raster map. So, i produce a raster map but I'm not able to
> compare with original image since there is a small displacement. How can
> I obtain a raster map without this mismatch?
> Thank you
> Regards,
> Antonio
>
> GDAL version 1.9.1
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20121025/1eb7e3a5/attachment.html>


More information about the gdal-dev mailing list