Open urskaufmann opened 1 month ago
When moving a tww_app.vw_tww_wastewater_structure
instance, the following geometries are translated in x and y direction:
wastewater_node.situation3d_geometry
mapping via fk_wastewater_structure
cover.situation3d_geometry
mapping via fk_wastewater_structure
There is no changing of the field values of reach_point.level
, thus no alterations to the labels. Also, a corresponding detail geometry is not moved either (which imho is a bug).
You write that the labels should be updated for the input and output geometries. Did you alter the corresponding values in tww_app.vw_tww_reach
?
@urskaufmann on this precise spot in the demo data from VSA (2645121.91, 1149929.21), I could reproduce some very strange issues. The reach points are not moving correctly and then it breaks the refresh sql function.
2024-07-16T15:47:31 WARNING Traceback (most recent call last):
File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\teksi_wastewater_plugin.py", line 374, in refreshNetworkTopologyActionClicked
self.network_analyzer.refresh()
File "C:\Users/pulpoar/AppData/Roaming/QGIS/QGIS3\profiles\pulpoar/python/plugins\teksi_wastewater\tools\twwnetwork.py", line 163, in refresh
transaction = self.nodeLayer.dataProvider().transaction()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: wrapped C/C++ object of type QgsVectorLayer has been deleted
If I move other wastewater structures or reaches it works well.
I think I got it :
But if you move the reaches separately, reach point should follow.
You write that the labels should be updated for the input and output geometries. Did you alter the corresponding values in
tww_app.vw_tww_reach
?
No, I did not change the level-values. I wanted to show with this example also the rules, how I1, I2 etc are defined. This works with the azimut of the latest reach-segment before the wastewater node. With the move in the example, the reach from manhole EK2 has new an azimut, that is bigger than the azimut of reach 1000 CS. So the I1 and I2 labels should change and this would also show, that every thing is calculated as expected. Because this labels did not change (not the levels, but the order of the input-reaches), it showed me, that some thing is wrong/not as expected.
PS: the mentioned rule with the azimuts works in most cases, but it shows not always the correct order of the reaches in the manhole (starting with azimut=0(north) and then clockwise).
0 is not north, but azimuth of O1
Sorry, forget this thing about the labels... Imo we have really a big problem if this reachpoints are not where the should be. There are four ways to move a record in vw_tww_wastewater_structure: with tool "Move Feature" or "Vertex Tool", both of them with Topological editing on or off. I tried all 4 possibilities and restarted QGIS after every try, because if I continue several tries, I got not always the same result and I don't no why (what is of course also not good). A try means: start TWW-project, enable editing of vw_tww_wastewater_structure, select topological editing on or off, choose the tool. Move the manhole 1.062 to the right. Take a screenshot. Click the TWW-SQL-button and refresh the screen that you can see the topology-layers (vw_network_segement and vw_network_node). Screenshot. Repair the whole thing, that every thing is as at the start (move back, SQL again, save, Quit QGIS).
The result:
try, vertex tool and topology editing on: I get error messages, because the topology-layers can not be changed by the tool. Node and vw_tww_wastewater_structure-record do not move similar with cover and reaches. After SQL, there are several vw_network_node-nodes missing:
try, vertex tool and topology editing off: no errors. After Moving it looks as expected: after sql it shows, that the reach points have not moved:
try, move features tool, topology editing on: no errors. After Move the same as try 2, means ok:
After sql, the same as try 2, not ok:
one of the mysterys of this tries was, that at some cases, I was not able to move back the manhole 1.062 with the vertex tool, and that in these cases it was not possible to move the vertex points of the reaches, because the vertex tool did snap to the reaches at the old place and not at the place where the lines are drawn!:
At the end, I did an export of these lines after a try 3 (SIA405 export, only selected reaches, saving after the move). Export was successful:
I did open this xtf-file with QGIS:
There are five reach-points at the old place and the reach-lines do not end at the reach-points place! It's a no-go!!
I think I got it :
- Move a wastewater structure linked to reaches without having QGIS topology editing "ON" will adapt reach geometries but will not update reach points.
Topology editing on or off: it's always the same behaviour: reach geometries do update, reach points do not update.
The result:
1. try, vertex tool and topology editing on: I get error messages, because the topology-layers can not be changed by the tool. Node and vw_tww_wastewater_structure-record do not move similar with cover and reaches.
I see two problems here: first, you try to update a materialized view and second, the geometry type of tww_od.network_segment should be CompoundCurve. We should set the topology layer to "not editable" in the project file.
After SQL, there are several vw_network_node-nodes missing:
No clue why this happens, maybe due to the error message.
4. try, move features tool, topology editing off: same results as try 2 and 3...
This can be solved in the trigger function, Pull request following
Start situation
move with vertex tool, topological editing, cover and reaches I1, I2 move double distance
after undo-button: reaches I1 and I2 and cover are half way back nomore undo possible (just discard saving helps).
This behaviour only with vertex tool and topological editing. Without topological editing and with move features tool it works
The problem is that with topology_editing, we move the reach position in the qgis project first and then apply the dx/dy on the wastewater structure afterwards. We cannot support both ways of editing.
For me, using the topology setting is more intuitive than having a blackbox on the database move your geometries.
It should work if the reach ends/starts at the wastewater_node and also if the reach ends/starts not at the wastewater_node (nicht Pickelloch-Modell). Topological_editing works with Pickelloch. Does it really work also with "not-Pickelloch"?
With "not-Pickelloch", QGIS does not detect the topology, so only the db side triggers are used. Should we trigger the movement of reach/reach_point on the db only if there is a detail geometry?
I have a not-Pickelloch Werkplan, where node, cover and reachpoints have each seperate geometry also with manholes (Normschacht NW 800, 1000, 1100/900 etc) without detailgeometry. For me, this triggers are necessary.
I think it would be nice/should be the goal, that the way the user moves a manhole (vertex tool or move features tool, with/without topological editing) does not matter, the result should always be the same. If this is not possible, we have to write it in the docu very clear (the docu must be rewriten anyway).
I think having the same result with and without topological editing is not feasible
Describe the bug I try to rewrite the chapter 3.3.2 Moving... and I do not understand what really happens when I move a wastewater structure (point in vw_tww_wastewater_structures). Look the pictures. I turned the topology on to show the move.
As a result of the move, the Input-levels should change. Before is I1=2736.51, I2=2736.52, after it should be I1=2736.52, I2=2736.51. But the label does not change.
I then save all edits, and I refresh network topology (SQL-button). The label does not change.
Really strange is, that the network_nodes (vw_network_node) stay at the old place. After the move, there is no node or cover at the place, where there are still the network_nodes. I choose again refresh network topology, close QGIS and restart, refresh, but the network_nodes stay at the old place....
What happens here? Why this behaviour? How to correct this? If I change e.g. the vertex of the reach with to-level 2736.51, then this network node changes with the SQL-button and the label changes as described above. But this can not be a solution...
Desktop (please complete the following information):