[Qgis-user] polygon raster overlap
John C. Tull
john.tull at wildnevada.org
Mon Mar 2 19:24:11 PST 2009
On Mar 2, 2009, at 3:14 PM, Declan Troy wrote:
> Hi all,
>
> I'd like to be able to overlay a series of polygons over a land
> cover raster to ascertain the composition (area or proportion) of
> the raster classes within the polygons. I think this should be a
> rather straightforward procedure.
>
> So far I don't see a way of doing this directly in Qgis (maybe an
> "ftools" for rasters will appear). Have I overlooked something?
>
Nothing directly, but it is possible with the GRASS tools.
> I presume this can be done in GRASS (not sure of the procedure yet).
> Would the easiest approach be to do this via grass tools in Qgis or
> directly in GRASS? Would it be necessary to ship all layers to
> GRASS or does Grass Tools allow analysis of Qgis layers on Grass
> layers?
Personally, I like to do my GRASS work in GRASS, then either export
files out of GRASS or use the vector and raster GRASS layer tools from
the GRASS plugin for visualizing the information.
For GRASS tools, everything has to exist in a GRASS mapset, then the
files have to be added to the Qgis canvas for them to be available for
GRASS operations using GRASS tools. I hope that makes sense. It took
me a while to get used to this logic, and I simply found it easier to
work in GRASS independently.
If I understand your problem, you're looking at getting your layers
into a mapset (qgis can simplify this if you are not used to creating
GRASS mapsets), then you want to clip your raster with your various
vectors. I generally do this by using v.to.rast and set the raster as
a MASK in GRASS. You can then use r.mapcalc to create the raster that
is clipped by the vector shape (r.mapcalc raster_clipped=raster). You
can then use r.stats to get your areas.
Regards,
John
More information about the Qgis-user
mailing list