With release 7.1. of the QGIS Model Baker the backend library is separated from the graphical components. As well there PostgreSQL services are supported (pg_service.conf) in the database selection as well as the SSL mode. Another nice thing is the new "Link Child Dialog" in the Relation Editor Widget provided by the new plugin [Linking Relation Editor](https://plugins.qgis.org/plugins/linking_relation_editor/)
Linking Relation Editor
With Qgis Model Baker the [Linking Relation Editor plugin](https://github.com/opengisch/qgis-linking-relation-editor) is loaded as dependency. When a project is generated this widget type is chosen as the Relation Editor Widget.
![image](https://user-images.githubusercontent.com/28384354/162380657-051f5d11-a02e-4aea-9b3c-fbca49b5100c.png)
When linking child features there will be opened a much more comfortable dialog, than we are used to.
![image](https://user-images.githubusercontent.com/28384354/162382180-6e4569a8-0984-4ea3-9bed-caa590dc35f0.png)
Features:
- Ability to filter the list of available features with a search considering the display message
- "Select on Map" button to filter the list of available features
- The usual filter possibility to filter the available features
- Buttons to move features from the available features list to the linked children list (what links them to the parent, means sets the FK of the parent) and << >> to move all features
- When opening this dialog the already linked features are already there
- Using tooltip/maptip to display the attributes on roll over an item of the available features
> Sponsored by: QGIS Model Baker Group
Loading of additional layers in UsabILIty Hub topping
We can now define additional layers in the layertree file by adding the QLR path/link or the data source.
Additionally it's possible (and suggested) to define the QML path/link directly in the layertree file as well.
Example
yaml
layertree:
- "KbS_LV95_V1_4 Layers":
group: true
child-nodes:
- "Belasteter_Standort (Geo_Lage_Punkt)":
qmlstylefile: "ilidata:ch.opengis.topping.opengisch_KbS_LV95_V1_4_004"
- "Other Layers":
group: true
child-nodes:
- "Roads from QLR": layer called "The Road Signs" with qlr source
definitionfile: "../qlr/the_road_signs.qlr"
- "QLR-Group": group called "Simple Roads" with qlr source
group: true
definitionfile: "../qlr/simple_roads_complete.qlr"
- "Local WMS": direct source definition for WMS
provider: "wms"
uri: "contextualWMSLegend=0&crs=EPSG:2056&dpiMode=7&featureCount=10&format=image/jpeg&layers=ch.bav.kataster-belasteter-standorte-oev_lines&styles=default&url=https://wms.geo.admin.ch/?%0ASERVICE%3DWMS%0A%26VERSION%3D1.3.0%0A%26REQUEST%3DGetCapabilities"
Direct source
Currently supported provider types are `ogr`, `postgres` and `wms`.
Conceptional changes
With this functionality it made sense to change the concept. ***Still it's fully backwards compatible with the old keywords etc.***
With the project topping file we have the QGIS project part there, while the ili2db settings / Model Baker settings / data part is in the metaconfig still. So everything is at one place, the linking in the layer tree is more readable and understandable and a layer is unique considering it's name and position.
Renaming of the layertree to projecttopping
The layertree is not called layertree anymore since it contains more information (an will in future) than just the legend.
For that in the metaconfiguration file you will now have instead of `qgis.modelbaker.layertree` the parameter:
ini
[CONFIGURATION]
qgis.modelbaker.projecttopping=ilidata:ch.opengis.config.KbS_LV95_V1_4_projecttopping
In the ilidata.xml there is a new type `http://codes.interlis.ch/type/projecttopping` replacing `http://codes.interlis.ch/type/layertree`.
And inside the projecttopping file (YAML) you will have the section `layertree:` instead of `legend:` since it's more than a legend now.
Definition of the QML files in the project topping file (YAML)
Previously we defined the mapping between layernames and stylefiles in the metaconfiguration like this:
ini
[qgis.modelbaker.qml]
"Belasteter_Standort"=ilidata:ch.opengis.topping.opengisch_KbS_LV95_V1_4_001
Now best practice is to define the qml files in the layertree. Like in the above example.
> Sponsored by: Swisstopo - Bundesamt für Landestopografie (Landesgeologie)
PG Service Conf and SSL
Choose the DB settings from the local [service configuration file](https://www.postgresql.org/docs/current/libpq-pgservice.html)
The service conf file is found by the python package [pgserviceparser](https://github.com/opengisch/pgserviceparser) and this is published on [PYPI](https://pypi.org/project/pgserviceparser/). As well as the modelbaker library the pgserviceparser is shipped as downloaded package in the plugin.
![image](https://user-images.githubusercontent.com/28384354/162385126-3d98a5af-7b78-48ab-b7f3-4674b22de03a.png)
SSL mode
As well SSL is possible now:
![Peek 2022-03-04 16-42-sslmode](https://user-images.githubusercontent.com/9881900/156794249-27487528-2171-47af-be89-8b004a0cdef4.gif)
> Sponsored by: [SO!GIS](https://so.ch/verwaltung/bau-und-justizdepartement/amt-fuer-geoinformation/)
The modelbaker library
The whole backend part to interact with ili2db and to generate the QGIS project is moved to a [separate repository](https://github.com/opengisch/QgisModelBakerLibrary)
This step allowes the people from QGIS Model Baker plugin a more proper maintanance of frontend and backend. It provides a stable library that can be used by anyone else and gives freedom in modeling the plugins for the needs of the users. There are no functional or legal limitations introduced with this change.
The library is available as well as a Python Package at [PYPI](https://pypi.org/project/modelbaker/). It's now possible to install it with pip as well:
pip install modelbaker
On packaging the QGIS Model Baker Plugin, the modelbaker library wheel file is downloaded and shipped as part of the plugin. This means a change of the systems installation of modelbaker library won't change the version of the one shipped with the plugin.
The current version of the modelbaker library is 1.0.4
Removed old single dialogs
The single dialogs are removed with this version. They included legacy code and all the functionalities are covered with the wizard. The menu looks much nicer now:
![image](https://user-images.githubusercontent.com/28384354/162399580-e8d2b6d9-93ff-4b44-9f0f-4f162db8c9ec.png)
ili2db
In the current release we still use ili2db version 4.6.1
Known issues
669