I’ve never really liked the QGIS processing model builder. It is not very user friendly, it lacks features and it is visually displeasing. Still, being an integrated part of QGIS, it is available to hundreds of thousands of users, it is improving and it has a lot of potential. So, in this case, I wanted to create a model to proccess vector data and write the result to PostGIS. The data consists of municipalities that need to be clipped and processed:
The steps are:
- Read two vector data sets: municipalities and ocean
- Process the data: manage geometries and attributes
- Write the result to PostGIS
The final result looks like this:
A few notes:
- Use comments to add context to the model components. That will make it easier to understand the workflow.
- Use group boxes to categorize the components, such as “Input”, “Output”, “Geometry”, “Attribute management” etc. Your future self will thank you for making the model more accessible and easier to tweak.
- If you can´t find an appropriate algorithm, always check the “Field calculator”, as it has a lot of features built in.
- Try to remove unnecessary data as early as possible in the model, as it will do its very best to complicate your process otherwise. In my case, I used the tool “Refactor fields” to remove unwanted attributes and rename the remaining attributes to better suit PostGIS (lower case). Doing this is especially important as your model grows, which always seems to be the case.
- If you run into problems with a specific algorithm, try running it as a separate tool in the “Processing Toolbox”. That can make it easier to isolate and handle the issue.