Repository navigation
8.4.0
Pre-releaseThis release comes with two main features. One is more visible than the other, but the other is no less important for the future evolution of Model Baker. First, we made the toolbox of Model Baker Processing Algorithms "complete". Among others, we are now able to import INTERLIS schemas and create baskets. The other feature is called Settings Prophet, but it's invisible. With the help of the ili2py package, Model Baker parses the INTERLIS model before ili2db is called. With this, parameters can be set automatically and/or hidden depending on the model's characteristics, and the user does not need to be confronted with them. This is a first step in making the powerful Model Baker plugin easier to handle without having to restrict functionality.
New Model Baker Processing Algorithms
Import INTERLIS models with ili2db
The settings are the same as those that can be set among other places in the Advanced Options in the wizard.
Create Baskets
Creates baskets in a database according to the ili2db meta information. You can choose to create baskets for all topics or only for relevant topics. You can also specify a template for the Basket ID.
Util algorithm to get parameters from connection
Parses the connection configured in the Data Source Manager for the database parameters to be used in the Model Baker ili2db algorithms.
Documentation
Btw. the documentation is updated with a detailed description of every Model Baker Process Algorithm and a Processing Model Example is provided like this:
Valued Sponsors
Financed by the QGIS Model Baker Group
Settings Prophet integration
With the help of the ili2py package, Model Baker parses the INTERLIS model before ili2db is called. With this, parameters can be set automatically and/or hidden depending on the model's characteristics, and the user does not need to be confronted with them.
This means in the advanced options of schema import:
- it hides/unhides the Basket Column Setting depending on whether a basket column is required
- it sets the Basket Column Setting depending on whether a basket column is required. If it is not required, it does not touch the setting (meaning it does not unset it)
- it hides/unhides the StrokeArcs Setting depending on whether arcs are found in the model
- it hides/unhides the Multiple Geometry Columns Setting depending on whether multiple columns are found in a class of the model.
- it hides/unhides the Multiple Enumeration Setting depending on whether enums are found in the model.
- it hides/unhides EnumTabs option if extended enums are found in the model and smart1 is chosen -> this is interactive, see below.
- it hides/unhides the Translation Setting if it detects the model as a translated model.
Examples
Special behavior with extended enumerations on smart 1
Extended enumerations cannot be handled with smart1 inheritance strategy and enumTabs option. This means we have to avoid this combination. When changing to smart1, it hides enumtabs, and if enumtabs was currently active, it jumps to singleenumtab. When changing back to smart2 it remains on singleenumtab (meaning it does not set it back - this is because otherwise it would be too confusing).
And what is technically done
In the ImportSchemaConfigurationPage:
- it get the checked models with their source (local or repository)
- for each model, it gets the local file path (download if necessary)
- for each model, it compiles the model to get the metamodel (imd file) if not already cached
- for each model, it creates a
BakerPyIndexfrom the imd file - it creates a
SettingsProphetwith the model indexes and the MODELS_BLACKLIST (usingModelProphets) - it load the prophety settings into the ili2db_options
... and this is all part of the model baker library and easy to use with python.
# compile with ili2c via modelbaker library
from modelbaker.utils.ili2db_utils import Ili2DbUtils
_, imd_file, _ = Ili2DbUtils().compile('/home/freddy/ilimodels/Nutzungsplanung_V1_2.ili')# create index to get info about the model characteristics (ili2py in the background)
from modelbaker.ili2pytools.pythonizer import BakerPyIndex
index = BakerPyIndex.from_imd(imd_file)
# get some infos
all_topics = index.submodel_in_package
nupla_topics = all_topics.get("Nutzungsplanung_V1_2")# create ModelProphet to get info more convenient
from modelbaker.ili2pytools.prophets import ModelProphet
model_prophet = ModelProphet(index, "Nutzungsplanung_V1_2")
# get some infos
has_ext_topic = model_prophet.has_extended_topics()
has_bids = model_prophet.has_basket_oids()# create SettingsProphet to get info more convenient about a whole set of model
from modelbaker.ili2pytools.prophets import SettingsProphet
settings_prophet = SettingsProphet({model_name: index, model_name2: index2})
# get some infos
needs_basket = settings_prophet.needs_basket_column()
arcs = settings_prophet.contains_arcs()More about the back end development here opengisch/QgisModelBakerLibrary#175 and here opengisch/QgisModelBakerLibrary#171 and for the compiler part here opengisch/QgisModelBakerLibrary#160
Valued Sponsors
Financed by the QGIS Model Baker Group
Other improvements and fixes
- Foreign Keys to irrelevant layers should be ignored on check if the layer is a pure link table or not: #1178
- Fix trying to export toppings on virtual and "subseted" layers without source: #1179
- Small fixes of misbehavior by in #1183
- Fix precision on range widget of GeoPackage layers opengisch/QgisModelBakerLibrary#182
ili2db
Using ili2db version 5.5.2
Library
Using modelbaker library 3.4.0
Full Changelog: v8.3.10...v8.4.0

