[GIS] Processing modeler: how to dissolve a vector layer and sum the attributes

dissolvefields-attributesqgisqgis-processing

I have a complex workflow prepared in the processing modeler, but I'm missing one step to link all the model.

I need to dissolve a polyline vector in a single line vector that has as attribute the SUM of a specified attribute of the polyline vector.
I can do it via plugin (dissolve with stats) but just outside the modeler, I tried to find a way to link the "dissolve" tool and the "basic statistics for numeric field" tool but I still can't figure out how to put the html output inside the vector layer.

I saw some comments about an sql query that looks easy, but I don't know if I can use it outside spatialite or sql, inside the modeller.

I tried the command SELECT SUM(column_name) FROM table_name;

but as out put i got GDAL command output:
FAILURE:
Unable to open datasource

Is it because the layer has to be inside an sql database to run this kind of query?

Best Answer

You can use gdal/ogr tool inside your modelbuilder :

enter image description here

hope that helps

Related Question