4.1. Datenmanager

4.1.1. Daten in QWAT importieren

Im Allgemeinen wird bevorzugt, Daten durch die Views und nicht die Tabellen zu importieren. Dadurch wird sichergestellt, dass die Businesslogik in den Edit Triggers dieser Views berücksichtigt wird (bspw. Knoten und Topologiebehandlung).

Eine [nette alternative Technik](git@github.com:nliaudat/qwat-import-sample.git) wird von Nicolas Liaudat vorgeschlagen, die direkt QGIS und Ausdrücke verwendet, um Datensätze zu laden. Bitte tragen Sie dazu bei, wenn Sie Verbesserungen von Problemen finden.

4.1.2. Daten von Topobase importieren

  • describe the process and tools

  • describe the automated and manual checks to do

  • mention specific point of attention

4.1.3. Daten nach INTERLIS SIA 405 exportieren

Exporting a QWAT database to the Interlis Exchange Format (.xtf) is possible using the dedicated tool qgepqwat2ili developped as part of an NGDI project.

4.1.3.1. Usage

Qgepqwat2ili benötigt Java (JRE 1.6 oder höher) und Python (3.6 oder höher) .

Danach kann es wie jede andere Python-Bibliothek installiert werden:

pip install --upgrade qgepqwat2ili

Ein simpler Export kann wie folgt durchgeführt werden (angenommen, es besteht ein pgservice namens qwat):

python -m qgepqwat2ili qwat export desktop/my_export.xtf

Full usage:

usage: python -m qgepqwat2ili qwat [-h] [--recreate_schema] [--skip_validation] [--pgservice PGSERVICE] [--log] [--include_hydraulics] export path

positional arguments:
{import,export}       import is currently not supported
path                  path to the input/output .xtf file

optional arguments:
-h, --help            show this help message and exit
--recreate_schema     drops schema and reruns ili2pg importschema (default: False)
--skip_validation     skips running ilivalidator on input/output xtf (required to import invalid files, invalid outputs are still generated)
                        (default: False)
--include_hydraulics  if provided, exports will include hydraulischer_strang and hydraulischer_node classes (these are currently likely to make the export invalid due to issues with the current ili model) (default: False)
--pgservice PGSERVICE
                        name of the pgservice to use to connect to the database (default: qwat)
--log                 saves a log file next to the input/output file (default: False)

Further documentation as well as an issue tracker can be found on the qgepqwat2ili repository.

4.1.3.2. Limitations

The tool is currently experimental. Please be aware of the following limitations:

  • The tool has not yet been tested much with actual data.

  • The QWAT datamodel and the SIA 405 datamodel have some important differences. Thus, not all classes or properties can be matched precisely.

  • By default, the tool does not export hydraulic classes. An option must explicitely be added to do so, but this will result to invalid files, due to differences mentionned above.

  • The tool is currently only available as a command line tool. It will at some point be embedded in the QWAT plugin, similarly to what was done for QGEP.

  • The tool currently supports only export. Supporting imports is planned, but this require larger changes to bring the QWAT datamodel closer to the SIA405 norm.

Make sure that you carefully review the resulting data, and ensure you are getting expected results before distributing your files. Also please report any error or inconsistencies that you are getting on the qgepqwat2ili issue tracker to help improving the tool.

4.1.4. Export data to SIRE

  • describe the process and tools

  • describe the automated and manual checks to do

  • mention specific point of attention

4.1.5. Backup data

  • Use PostgreSQL backups

  • points of attention (PG versions…)

4.1.6. Restoring data

  • Use PostgreSQL backups

  • points of attention

4.1.7. QWAT analysis tools

  • Where to find data analysis scripts

  • How to use them