5.2.2. Data collection policy
5.2.2.1. Mapping
The AG-64/AG-96 object-ids are mapped to the database as follows:
Infrastrukturknoten/GEPKnoten is mapped to
tww_od.wastewater_nodeInfrastrukturhaltung/GEPHaltung is mapped to
tww_od.reachUeberlauf_Foerderaggregat is mapped to
tww_od.overflowEinzugsgebiet is mapped to
tww_od.catchment_areaSBW_Einzugsgebiet is mapped to
tww_od.catchment_area_totalsGEPMassnahme is mapped to
tww_od.measureVersickerungsbereichAG is mapped to
tww_od.infiltration_zone
Wherever possible, the value lists of VSA DSS are used. In cases where a 1:1 mapping is possible, there is no additional value list entry for AG-64/96. Instead, one can use the corresponding VSA-DSS value which is translated on export. These cases are listed below.
Almost all VSA-DSS values of the mentioned layers that do not exist in AG-64/96 are mapped to AG-64/96 using a backwards relation. Per default, the VSA-specific value list codes which are ambiguous in AG-64/96 are set to inactive.
The AG-64/96 values are automatically mapped to VSA DSS where sensible, allowing to export both models.
5.2.2.1.1. Handling of organisations
In the models AG-64/AG-96, the organisations table differs from VSA. It has 20 characters and uses a different prefix. In order to maintain the VSA compatibility, TWW 2 AG-64/96 uses the VSA tables.
There is a set of private entities in the AG-64/AG-96 organisations dataset that were not ported to VSA DSS. For these organisations, we use a OID prefix that was generated solely for this purpose and the AG-64/AG-96 postfix. The corresponding data is imported on initialisation.
When exporting a dataset, the organisations are not exported from the TEKSI database. Instead, the AG-64/96 Organisation dataset is stored within the plugin and added to the export dataset.
5.2.2.1.2. Last Modification
in AG-64/96, the last modification value of cadastre and general planning are separated. To keep track of them, they are managed on the database. There is a widget in the settings to alter the current value, see here .
5.2.2.2. Infrastrukturknoten/GEPKnoten
The base OID for the Infrastrukturknoten/GEPKnoten is taken from tww_od.wastewater_node.
The FunktionAG is mapped from
manhole.function
special_structure
infiltration_installation.kind
discharge_point.relevance
wastewater_node.ag64_function
wwtp_structure.obj_id
measurement.obj_id
The FunktionAG Kontrollschacht is not included in the value list. Use manhole or combined_manhole instead, which are mapped using a backwards relation.
The following table explains the mapping of FunktionAG in detail. If there are multiple options for TWW class, the type is defined dependent on whether a detail geometry exists. The value_de is only listed if the AG-64/96 value is not eligible
Value in AG-64/AG-96  | 
structure type  | 
Comment  | 
|---|---|---|
abflussloseGrube  | 
special_structure  | 
|
Absturzbauwerk  | 
special_structure / manhole  | 
|
Abwasserfaulraum  | 
special_structure  | 
|
Abwasserreinigungsanlage  | 
wwtp_structure  | 
regardless of   | 
andere  | 
special_structure / manhole / wastewater_node  | 
|
Anschluss  | 
wastewater_node  | 
|
Be_Entlueftung  | 
special_structure / manhole  | 
|
Bodenablauf  | 
manhole  | 
|
Dachwasserschacht  | 
manhole  | 
|
Duekerkammer  | 
special_structure  | 
|
Duekeroberhaupt  | 
special_structure  | 
|
Einlaufschacht  | 
manhole  | 
|
Einleitstelle_gewaesserrelevant  | 
discharge_point  | 
|
Einleitstelle_nicht_gewaesserrelevant  | 
discharge_point  | 
|
Entwaesserungsrinne  | 
manhole  | 
|
Faulgrube  | 
special_structure  | 
|
Gelaendemulde  | 
special_structure  | 
|
Geleiseschacht  | 
manhole  | 
|
Geschiebefang  | 
special_structure  | 
|
Guellegrube  | 
special_structure  | 
|
Klaergrube  | 
special_structure  | 
|
Kontrollschacht  | 
special_structure / manhole  | 
use   | 
Leitungsknoten  | 
no wastewater structure  | 
|
Messstelle  | 
measurement not in special construction  | 
|
Oelabscheider  | 
special_structure / manhole  | 
|
Oelrueckhaltebecken  | 
special_structure  | 
maps to   | 
Pumpwerk  | 
special_structure / manhole  | 
|
Regenbecken_Durchlaufbecken  | 
special_structure  | 
|
Regenbecken_Fangbecken  | 
special_structure  | 
|
Regenbecken_Fangkanal  | 
special_structure  | 
|
Regenbecken_Regenklaerbecken  | 
special_structure  | 
|
Regenbecken_Regenrueckhaltebecken  | 
special_structure  | 
|
Regenbecken_Regenrueckhaltekanal  | 
special_structure  | 
|
Regenbecken_Verbundbecken  | 
special_structure  | 
|
Regenueberlauf  | 
special_structure / manhole  | 
|
Regenwasserrechen  | 
special_structure  | 
|
Regenwassersieb  | 
special_structure  | 
|
Rohrbruecke  | 
special_structure  | 
|
Schlammfang  | 
manhole  | 
maps to   | 
Schlammsammler  | 
manhole  | 
|
Schwimmstoffabscheider  | 
special_structure / manhole  | 
|
seitlicherZugang  | 
special_structure  | 
|
Spuelschacht  | 
special_structure / manhole  | 
|
Strassenwasserbehandlungsanlage  | 
special_structure  | 
maps to   | 
Trennbauwerk  | 
special_structure / manhole  | 
|
unbekannt  | 
special_structure / manhole  | 
|
Versickerungsanlage.Versickerungsbecken  | 
infiltration_installation  | 
|
Versickerungsanlage.Kieskoerper  | 
infiltration_installation  | 
|
Versickerungsanlage.Versickerungsschacht  | 
infiltration_installation  | 
|
Versickerungsanlage.Versickerungsstrang  | 
infiltration_installation  | 
use   | 
Versickerungsanlage.Versickerungsschacht_Strang  | 
infiltration_installation  | 
use   | 
Versickerungsanlage.Retentionsfilterbecken  | 
infiltration_installation  | 
maps to   | 
Versickerungsanlage.andere  | 
infiltration_installation  | 
maps to   | 
Versickerungsanlage.unbekannt  | 
infiltration_installation  | 
|
Vorbehandlung  | 
special_structure  | 
use   | 
Wirbelfallschacht  | 
special_structure  | 
5.2.2.2.1. Handling of building connections
Building connections are defined in the datamodel as Infrastrukturknoten/GEPKnoten with funktionag “Anschluss”. As these are no wastewater structures, the function is attributed to the wastewater node (wastewater_node.ag64_function).
5.2.2.2.2. Handling of covers
The AG-64/AG-96 data collection guidelines state the following:
The main wastewater node of a manhole or special structure must be mapped to the location of the main cover.
Secondary covers are mapped as Infrastrukturknoten/GEPKnoten with funktionag “andere”.
As topological relations to a node of funktionag “andere” are technically possible, we need to link all covers to a wastewater node using tww_od.cover.ag64_fk_wastewater_node.
In order to follow these limitations, there is an additional foreign key on tww_od.cover pointing to tww_od.wastewater_node. A wastewater node’s situation geometry is only overruled if it is referenced from a cover.
Additionally, the attribute wastewater_node.ag64_function can be set to “andere”.
5.2.2.2.3. Handling of the attribute “IstSchnittstelle”
AG-96 has an attribute IstSchnittstelle which is not present in VSA DSS 2020.1. The value is stored in tww_od.wastewater_node.ag96_isgateway.
5.2.2.3. Infrastrukturhaltung/GEPHaltung
Apart from street water and square water, the NutzungsartAG are not modelled as a value list extensions. Use the backwards relation instead.
5.2.2.3.1. Handling of reach-reach connections
AG-64/96 does not support reach-reach connections. If needed, the DSS topology is overridden on AG-64/96 export by a foreign key on tww_od.agxx_reach_point.ag64_fk_wastewater_node that points to tww_od.agxx_unconnected_node_bwrel.  are defined in the datamodel as Infrastrukturknoten/GEPKnoten with funktionag “Anschluss”. When this foreign key is not set, reach-reach connections throw an error on export.
5.2.2.4. Ueberlauf_Foerderaggregat
The layer Ueberlauf_Foerderaggregat is mapped to tww_od.overflow and its specialisations
5.2.2.5. GEPMassnahme
GEPMassnahme is mapped to tww_od.measure. The following categories can be mapped 1:1 onto a VSA DSS value and therefore have no separate value list entrance.
Value in AG-64/AG-96  | 
value_de in TWW  | 
|---|---|
Reinigung  | 
Erhaltung_Reinigung  | 
Retention  | 
Abflussvermeidung_Retention_Versickerung  | 
Sonderbauwerk.Neubau  | 
Sonderbauwerk_Neubau  | 
5.2.2.6. Bautenausserhalbbaugebiet
Bautenausserhalbbaugebiet is mapped to tww_od.building_group. There is no backwards mapping from VSA-DSS Gebaeudegruppe.Sanierungsbedarf to AG-96 Bautenausserhalbbaugebiet.Sanierungsbedarf because the value unbekannt cannot be mapped.
5.2.2.7. SBW_Einzugsgebiet
SBW_Einzugsgebiet is mapped to tww_od.catchment_area_totals. The perimeter geometry is stored as an extension geometry attribute (ag_96_perimeter_geometry). In order to alter it, one needs to manually import the layer into the qgs project.
There exists a function to calculate the perimeter geometry by aggregating the catchment areas via catchment_area->log_card->main_log_card->hydraulic_char_data->catchment_area_totals. The perimeter geometry is a MultiSurface, while the INTERLIS model requires a CurvePolygon. According to the official data collection policy of the Canton, one should violate the datamodel and export a MultiPart. As the underlying export mechanism ili2pg does not allow to export a wrong geometry type, only the biggest Singlepart is exported.
5.2.2.8. VersickerungsbereichAG
VersickerungsbereichAG is mapped to tww_od.infiltration_zone.