Skip to content

Instantly share code, notes, and snippets.

@signedav
Last active April 8, 2022 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save signedav/67ecbc6a9389ca6ae160be413147a28f to your computer and use it in GitHub Desktop.
Save signedav/67ecbc6a9389ca6ae160be413147a28f to your computer and use it in GitHub Desktop.
Changelog 7.1.0

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

Linking Relation Editor

With Qgis Model Baker the Linking Relation Editor plugin is loaded as dependency. When a project is generated this widget type is chosen as the Relation Editor Widget.

image

When linking child features there will be opened a much more comfortable dialog, than we are used to. image

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

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:

[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:

[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

The service conf file is found by the python package pgserviceparser and this is published on PYPI. As well as the modelbaker library the pgserviceparser is shipped as downloaded package in the plugin.

As well SSL is possible now: image Peek 2022-03-04 16-42-sslmode

Sponsored by: SO!GIS

The modelbaker library

The whole backend part to interact with ili2db and to generate the QGIS project is moved to a separate repository

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. 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.2

ili2db 4.7.0

In the current release we use ili2db version 4.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment