5

I am creating a habitat map for a woodland dependent species. I have multiple woodland polygons. Across the landscape the density of woodland varies widely and I would like to show that difference. I think the best way to show this would be with a raster grid, with cell colour relating to the percentage cover of woodland within that cell.

How do I convert polygons into a raster grid showing percentage cover?

The current woodland polygons I have, in the grid cells I want

3
  • What size of a grid are thinking of having? Commented Sep 20, 2016 at 14:53
  • 1km2 grid squares would be useful. Commented Sep 20, 2016 at 15:14
  • do you have grass gis installed or available to use the grass plugin or is it configured as a provider in processing? Commented Sep 20, 2016 at 21:16

1 Answer 1

5

To create the sum (or percent) of woodland area from a polygon layer, I would convert the polygons to a fine resolution - say 1 meter - raster, then use the GRASS raster module r.resamp.stats to get a coarse resolution raster with 1 km. pixels. Use the "sum" method to get the total number of woodland pixels from the fine resolution grid into the coarse resolution.

The GRASS functions:

# Import woodland polygons into GRASS and convert to raster # Assumes the woodlands shapefile in projected in some meters based CRS v.in.ogr input=woodlands.shp output=woodlands g.region -p vect=woodlands res=1 v.to.rast woodlands output=woodlands_rast type=area # Now get the coarse resolution raster with g.region -p res=1000 r.resamp.stats woodlands_rast output=woodlands_coarse method=sum # Get percent by dividing by total area of each pixel and multiply by 100 r.mapcalc "woodland_pcent = (woodlands_coarse / 1000000)*100" 

Note that there are some purpose built software for habitat analysis. For example you might want to check the LecoS plugin

2
  • Many thanks Micha, this is awesome. I've not used GRASS before so took me awhile to work out (resolution on a different tab, etc), but got there and the results are fantastic. Many thanks again! Commented Sep 21, 2016 at 12:56
  • Thanks for the warm reply. Once you get your feet wet in GRASS (pun intended...) you'll never look back. Commented Sep 22, 2016 at 9:41

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.