Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
urskaufmann opened this issue May 27, 2024 · 10 comments
Open

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

urskaufmann opened this issue May 27, 2024 · 10 comments
Labels
bug Something isn't working datamodel Concerns the datamodel

Comments

@urskaufmann
Copy link
Contributor

I just tried what happens, if

  • I delete the main_cover of a wastewater_structure with two covers: the remaining cover get's the new main_cover. Good!
  • I delete the main_node of a wastewater_structure with two nodes: the symbol goes to the existing cover (not node!), the main_node stays empty, I have no ui to define a new main_node. I can create a next node in tab wastewater_nodes, but I can not save, because the main_node in tab main_cover/main_node is empty.

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 ponceta added bug Something isn't working datamodel Concerns the datamodel labels May 29, 2024
@ponceta
Copy link
Member

ponceta commented May 29, 2024

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 :

  • Link nodes
  • Link covers

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

  • Define main wastewater_node
  • Define main cover

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
Copy link
Member

ponceta commented May 29, 2024

Same behaviour for QGEP

@urskaufmann
Copy link
Contributor Author

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
Copy link
Member

ponceta commented May 30, 2024

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
Copy link
Contributor

sjib commented May 30, 2024

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
Copy link
Contributor

sjib commented May 30, 2024

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
Copy link
Member

ponceta commented May 30, 2024

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
Copy link
Contributor

cymed commented Jun 7, 2024

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.

@sjib sjib changed the title No Main-Node No Main-Node when main-node is deleted Jun 12, 2024
@ponceta
Copy link
Member

ponceta commented Jun 12, 2024

Find why cover and node main attribution differs in behaviour.

@3nids
Copy link
Contributor

3nids commented Jul 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datamodel Concerns the datamodel
Projects
None yet
Development

No branches or pull requests

5 participants