Skip to content

TEKSI INTERLIS Tool (TIT)

Stefan edited this page Sep 17, 2024 · 7 revisions

Import and export of INTERLIS files

TIT allows to import and export data with the INTERLIS format from the various TEKSI modules. It secures that data collected and maintained in all TEKSI modules can be imported and exported to the standard INTERLIS modeles of the respective technical association such as SIA, VSA, SVGW and Thermische Netze Schweiz.

Documentation

TIT should work similar to the TEKSI Wastewater module INTERLIS Import / Export but take the existing framework and functionality and place it in a separate plugin so it can be use for all TEKSI modules.

https://teksi.github.io/wastewater/admin-guide/interlis-io/index.html#

Concept and architecture

TIT builds up on the use of ModelBaker that allows to create a postgres (intermediary) schema from a (German) INTERLIS model file (ili). ModelBaker is using of ili2pg tools from Eisenhut Informatik to generate an import or export schema with the wanted INTERLIS data model (e.g. VSA-DSS / SIA405 Abwasser, VSA-KEK, etc.)

Schema to schema transfer with a series of matching scripts TEKSI schema < > ili2pg postgres schema: This includes

  • Translation Englisch – German (Classes / Attributes)
  • Conversion of value list to / from numeric values (Integer)
  • Restructuring of data from relational to object oriented modelling
  • Validating data before import or after export with ilivalidator

Based on the conception from TWW INTERLIS Import / Export tww_interlis_import_export

the configuration and architecture should be extended so it can be used for all TEKSI modules and supported models tit_interlis_import_export

GUI

  • The TIT plugin GUI is defined in plugin/teksi_interlis_tool/interlis/gui: It creates the buttons for INTERLIS Import and Export
  • The INTERLIS Import / Export GUI is defined in plugin/teksi_interlis_tool/interlis/gui: Export: It allows to select on export the model wanted and to choose if labels are exported and which is the rotation of the labels and to choose a path to save the xtf and select where logs are stored. Import: It allows to select the xtf file to import.

Matching scripts

The matching scripts are structured as follows: https://github.com/teksi/tit/tree/main/plugin/teksi_interlis_tool/interlis

  • Configuration (plugin/teksi_interlis_tool/interlis/config.py) Contains all configuration likes base directiory, ilivalidator version, model and topic name and schema prefix names

  • Import Export Process Definition (plugin/teksi_interlis_tool/interlis/interlis_importer_exporter.py)

  • Model Matchings (plugin/teksi_interlis_tool/interlis/interlis_model_mapping):

    • For each model a mapping file is created: model_base.py, model_interlis_sia405_abwasser.py, model_interlis_dss.py, model_interlis_vsa_kek.py
    • For each module a schema definition is created: e.g. twww: model_tww.py (schema) and model_tww_od.py (classes)
    • For export a matching order is defined in interlis_exporter_to_intermediate_schema.py
    • For import a matching order is defined in interlis_importer_to_intermediate_schema.py

Specific steps for adaption of TWW INTERLIS Import / Export to TIT INTERLIS Import / Export

General

  • Make a first version of TIT that does exactly the same as the current TWW INTERLIS Import / Export: https://github.com/teksi/TIT/issues/3
  • Make a second version that allows to import Schutzrohr and Fernwirkkabel data into TWW, TDH, qwat(TDW) module and any other further module to come
    • Parameter and filter to select module to export from / import to
    • This influences also the schema prefix of the classes
    • etc.

Import

  • New mapping for the following new models: SIA405_Fernwirkkabel, SIA405_Schutzrohr, SIA405_Fernwaerme (will be provided)
  • Add option to choose into which module data for Fernwirkkabel and Schutzrohr will be imported

Export

  • Matching for the following new models: SIA405_Fernwirkkabel, SIA405_Schutzrohr, SIA405_Fernwaerme (will be provided)

User friendlyness

For specific tasks and agile development for first, second, third version see https://github.com/teksi/TIT/milestones

Project Manager: Timothee Produit