4

At the moment I do this manually:

  1. open a shapefile
  2. open the attribute table
  3. use "select features using an expression" - the expression is "area" < 200
    1. then I use vector/geoprocessing tools/eliminate sliver polygons
    2. I select "common boundary", add a name and location for a new shapefile.

I have tried to automate this process using the modeller, but even after looking at some tutorials I could not achieve this.

Since I have many shapefiles, I would like to process them one at the time automatically. Note that the resulting shapefile should have the original shapefile name with a prefix or a suffix - I don't mind which.

After spending some time with QGIS, I had a look at the "Processing Toolbox" and I have tried "Eliminate Sliver Polygon" as a Batch Process. It seems like it should do what I am looking for - but I guess that my parameters are not correct and reading the help file did not help me. There are three entries that I have to fill in:

  • Selection Attribute
  • Comparison
  • Value

In "selection attribute" I have tried "AREA" (with and without quotes), but is this the correct parameter?

2
  • I don't see a real question. You want someone to write a program for you? Please see the Help for gis.stackexchange.com/help/how-to-ask – Brad Nesom May 19 '15 at 12:55
  • No, I don;t want someone to write a program. I want to know how to automate a process within QGIS using a GUI. I have edited my question - hopefully it will be more clear – user52354 May 19 '15 at 15:29
3

At the end I did not have to use the QGIS Modeler, even if probably its implementation would be more efficient of my solution.

I have used "Eliminate Sliver Polygon" from the "Processing Toolbox" as a "Batch Process". I have selected all my shape files, then manually filled in: Selection Attribute: name of the field in my table, in uppercase, no quotes; Comparison: selected from dropdown list; Value: entered the value without any quotes;

I then used the autofill option to enter a name for amended shap files.

This method is much quicker then running the same process for each layer/file manually. It could be improved if some parameters (Selection attribute, comparison and value) could be filled automatically or for multiple entries at once (not each at the time).

-2

The Qgis Modeler isn't near as good as the ArcGis equivalent. If you want to stay with Qgis // opensource. You should really start using python//pyqgis

Follow this link to Pyqgis

And in your case it isn't that complicated : a loop over all your layers, an applying 2 operations is all you need.

Here is a hint : To get hold of all your layers :

qgis.utils.iface.mapCanvas().layers()

1
  • Ok, but is it "impossible" to do what I want with the Modeler or just more cumbersome? I am not a programmer and reading about Python is like reading a foreign language for me. – user52354 May 19 '15 at 13:53

Your Answer

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