teksi / wastewater

[DEV] Future TEKSI wastewater module, adapted data model to fit VSA-DSS 2020 new standard
https://teksi.github.io/wastewater
GNU General Public License v3.0
2 stars 5 forks source link

No Main-Node when main-node is deleted #250

Open urskaufmann opened 5 months ago

urskaufmann commented 5 months ago

I just tried what happens, if

There should be a ui to choose/define a main_node and when deleting the main_node, the user should get at least a warning.

ponceta commented 5 months ago

Same behaviour for nodes and covers should be possible, I did not find where lies the difference between these two behaviours.

What is actually possible :

From vw_tww_wastewater_structure :

From wastewater_strucure (geographical selection is not possible if the detailled geometry has not been set)

Remark : This complexity comes from the fact that we can change main cover and main node attributes directly from the vw_tww_wastewater_structure, therefore changing its related fk_main_cover and fk_main_node would result in conflict with attributes (when changing main node, the node would inherit of some of the previous main node)

ponceta commented 5 months ago

Same behaviour for QGEP

urskaufmann commented 5 months ago

Is there a possibilty with QGIS-functionality to select one of the already existing nodes, that are already connected to the wastewater_structure, as the new main_node? Or other possibilty: if we import INTERLIS data, then the main_node is selected automaticaly. If there is a wastewater_structure without main_node, it's the same situation. So: if there is empty fk_main_node field, there should also automaticaly the next node be selected.

ponceta commented 5 months ago

A graphical way to do it in QGIS (in wastewater_structures)

  1. Define a relation : image
  2. Set relation reference widget for fk_main_wastewater_node image
  3. Open the wastewater form and click on the map to define the main node image

Extra : If we want the selection to be limited to the wastewater nodes referencing the wastewater structure, we could set a filter to propose only these entities but I would test that in the expression workshop of next QGIS user day (I do not know the syntax yet).

The simpler the better : If the logic exists for covers, make the definition of the fk_main_ws_node simply the next referencing ws_node.

sjib commented 5 months ago

If we want the selection to be limited to the wastewater nodes referencing the wastewater structure I think this is a must else we have a chaos

sjib commented 5 months ago

To think about (I have no preference yet): my question is also if a graphical selection is helpful or if a list to choose from (that offers only the connected nodes resp. covers) would'nt be the easier interface?

ponceta commented 5 months ago

To think about (I have no preference yet): my question is also if a graphical selection is helpful or if a list to choose from (that offers only the connected nodes resp. covers) would'nt be the easier interface?

Even with a tabular selection, the user is still able to see where the entity lies on the map through redlining.

cymed commented 4 months ago

We use sql functions on the db side after interlis imports, see #97. They are however not called by triggers. Also I am not fully sure about the behaviour for structures with more than 2 nodes.

ponceta commented 4 months ago

Find why cover and node main attribution differs in behaviour.

3nids commented 4 months ago

There is a trigger for the cover table which calls wastewater_structure_update_fk_main_cover (see tww_app.on_cover_change). There is no equivalence for nodes.