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?
Here is one suggestion. Functions are available from processing toolbox.
- Run Add Geometry attributes which will add a field length to a new in- memory layer.
- Run Statistics by Category on the in-memory layer with field length selected for stats and your category attribute chosen: The output of this will be a table: