[Qgis-user] Clip raster to irregular polygon

John C. Tull jctull at gmail.com
Tue Sep 28 11:18:38 PDT 2010


On Sep 24, 2010, at 2:40 PM, Giovanni Manghi wrote:

> Hi,
> 
> 
>> I have an irregular polygon within a raster. How can I create a new
>> raster that is clipped to the shape of the polygon? 
>> 
>> 
>> (Note: I'm aware GDAL can't do this:
>> http://trac.osgeo.org/gdal/ticket/1599 )
> 
> 
> I use this
> 
> gdal_rasterize -i -burn 255 -b 1 -b 2 -b 3 -l [SHAPELAYER] [SHAPEFILE]
> [RASTER]
> 
> or using a GRASS mask.

It seems non-intuitive that this is not in the gdal tools plugin. The tool marked clipper does something, although I'm not sure what. I would expect it to do the burn option with gdal_rasterize. Instead, it appears to be running gdal_merge.py, at least when I just tested it.

Perhaps this is a bug in gdal_tools?

Cheers,
John


More information about the Qgis-user mailing list