Create QGIS projects from database schemas or Interlis models
Using modelbaker library 1.1.1
Using modelbaker library 1.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
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.
When linking child features there will be opened a much more comfortable dialog, than we are used to.
Features:
Sponsored by: QGIS Model Baker Group
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.
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"
Currently supported provider types are ogr
, postgres
and wms
.
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.
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.
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)
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:
Sponsored by: SO!GIS
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.4
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:
In the current release we still use ili2db version 4.6.1
#669
--importBid
should be set on any update command. Since otherwise an update of a data from a model without stable BASKET IDs corrupts the previously imported data.utils.gui_utils
(and merge ui.py into it) as a moduls to keep all the extended widgets, views and models that can be used by multiple gui components of the plugin and utils.globals
to keep variables that are used by multiple parts of the plugin (not only gui) like CATALOGUESETWith the release 7.0. Model Baker introduces it's data validator as a new feature, but sets also a milestone after all those integrations in the last year like the UsabILIty Hub (6.5), the Wizard (6.6) and the proper handling of Baskets and Datasets (6.7).
Easy validation of the physical data against the ILI model. The data can be filtered by model, dataset or baskets.
The database connection parameter are emitted from the currently selected layer. Mostly this is representative for the whole project, since mostly a project bases on one single DB schema. In case of multiple used DB Schemas, it's possible to "switch" between the validation results when switching the layers.
ili2db
is used with the parameter --validate
, so no export of the data is needed. The output is parsed by Model Baker and provided in an interactive list.
Entries of the type Error
and Warning
are listed.
With right click on the error there is opening a menu with:
If the metaattribute [email protected]=ARRAY
is defined in the ILI model configure the corresponding widget in QGIS as "List".
In this release we use ili2db version 4.6.1
TidHandling
from settings table to decide if --importTid
/ --exportTid
needs to be passed on data import/export. TidHandling
is in the t_ili2db_settings
table when --createTidCol
is passed on schema import.T_KEY_OBJECT
table simulating a global sequence number. This is used because we edit the dataset and basket table.