I have a raster containing information on the land cover type in a region.
I also have an ESRI shapefile consisting of a grid composed of 2500 cells. I would like to calculate the percentage cover of each land cover type in each cell.

To do this, I vectorized my raster and dissolved the polygons to obtain a shapefile where each polygon is a land cover type. I then tried to use the intersection tool to obtain a shapefile with polygons for each land cover type in each cell. This procedure takes too much time however (days by my calculation). I have also tried to split the grid into smaller grids but still faced the same problem.

Is there a more effective way of obtaining what I want?

  • Would you be satisfied with the final output being in csv / table / dealt with in a spreadsheet?
    – BJW
    Apr 14 '20 at 12:22
  • How many landcover types are there? (to understand the combinations in the results)
    – BJW
    Apr 14 '20 at 12:23
  • Yes, I would prefer an output in csv format or similar. I have 33 different land use types.
    – cosalofa
    Apr 14 '20 at 12:45
  • maybe too much information to present in a table?
    – BJW
    Apr 14 '20 at 21:41
  • 1
    A 33 x 2500 table is exactly what I wanted. I obtained this by using the method I mentioned below. It took me three days though!
    – cosalofa
    Apr 17 '20 at 12:15

You can use Raster layer zonal statistics in which you can select the land cover raster layer as input file, and use the shapefile as zone layer. It will calculate the area (in the raster unit) of each land cover within each zone in the shapefile. Then it will be easy to calculate the percentage.

The tool is available from Processing toolbox -> Raster Analysis -> Raster layer zonal statistics.

Check the help above for more information.

enter image description here

I am using QGIS 3.10.4.

  • 1
    Thank you for your suggestion. Just for clarification, Raster zonal statistics requires a raster as a zone layer so I needed to rasterize my shapefile to use this method. Unfortunately it did not work for me. I assume it is because my land use data is all in one band,
    – cosalofa
    Apr 14 '20 at 10:15

In the end, I ended up using the Landscape overlay tool from the Landscape Ecology plugin. I divided my grid into six parts as it was too big for the tool considering my computer specs (8GB RAM i5-4310U CPU @ 2.00 GHz). It is a tedious affair as I have to run all parts for all land use types but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.