I am using QGIS to rank about 800 PV areas according to their potential. I have a vector (.shp) layer with certain areas in polygons (inc. attribute table, every polygon has it's own ID).

Now I would like to find out the avg. slope and orientation (compass or in degree 0-360) of every polygon. I already have a raster (.TIFF) with the slope (resolution 25m) over the full area.

Is it possible to calculate slope and orientation somehow automatic and import them as columns in the attribute table?

If there is no possibility to calculate with a function in the attribute table, what is the best way to calculate manual for every single polygon?

  • Please clarify, whether you already have the slope data or need to create it.
    – Erik
    Commented Mar 5, 2021 at 12:17
  • I have the slope data, I created it with the Raster Analysis tools of QGIS.
    – DeportX
    Commented Mar 5, 2021 at 12:37

1 Answer 1


You may use the SAGA-tool add raster values to features in order to add slope and orientation to your polygons. This probably requires degree values for the orientation, but still could lead to issues with areas facing north, where the orientation changes from 355 ° to 5 °.

You could bypass this issue by creating centroids for the polygons and then use add raster values to points on the centroids. Final step here would be join attributes by location in order to join the centroid attributes back to the polygons.

  • Can you explain this more in detail? Sorry I'm a QGIS beginner. When I use "add raster values to features" choosing at parameters the shape file, adding my raster as grid and choose "nearest neighbor" as interpolation, I get an error and no result.
    – DeportX
    Commented Mar 5, 2021 at 13:33
  • This is why I added the second paragraph @DeportX
    – Erik
    Commented Mar 5, 2021 at 13:36
  • Alright thank you very much, I will figure it out :)
    – DeportX
    Commented Mar 5, 2021 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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