3

I have shapefile data set (Road segments) my area of interest is to calculate the length of all road segments having a particular attribute, e.g.: sum of (length attribute) when Attribute1=something. How to do this in QGIS using python, graphical model or any suitable method?

Vince
  • 20,017
  • 15
  • 45
  • 64

1 Answers1

5

Here is one suggestion. Functions are available from processing toolbox.

  1. Run Add Geometry attributes which will add a field length to a new in- memory layer.
  2. Run Statistics by Category on the in-memory layer with field length selected for stats and your category attribute chosen: enter image description here The output of this will be a table:

enter image description here

Aquamarine
  • 1,176
  • 5
  • 12