-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add temporal Flow and Basin results to QGIS. #2208
Conversation
This is very very nice. I like how it dynamically fills in the tables and things I tried like adding a label with the flow rate just seem to work: Here I used If I remove a model and load it in in the same QGIS session it seems the show topology context is getting added another time: Also it seemed to only work for me on the results but not the Link layer? Further the BasinNode symbology uses These other things are perhaps better as follow ups:
|
If I do "remove group" on the HWS model and then open it again I consistently get:
|
I've seen this before and refactored a large part of the signals because of it, but I think it only triggers once you got another error first?
Sure, will add it. What do you suggest for Basin labels?
Yes, it only sets a variable on the layer, the style has to use that variable. Will update the default style to do so as well.
Ouch, nice find. It's hijacking of the contextmenu signal, and it does so for the DatasetWidget (repeated for each dataset), that should probably be the Ribasim widget, or check for an existing widget.
Sure, but that's hard to style consistently, would have to make an update symbology after arrow load for it, based on min/max or so. |
My guess here is that arrow layer in Python hasn't been updated after group deletion? Alternatively, you just catch the exception and update the Python state then? Might be the most robust and simple. |
Hmm by default nothing I guess so it doesn't get confused with flow rates? Otherwise
You wanted that for |
Another follow up, since I see you already add concentration data, would be to add allocation results, see also #2196. |
…e don't try to update them later.
… Hide result group by default.
And adds "show topology" button on the layer context menu.
Fixes #2178
Fixes #2171
This creates a new Results group in QGIS for each loaded model, and adds a BasinNode and FlowLink layer to it. These are duplicates of the Node and Link layer for the result data (and thus only keeping
node_type=Basin
, andlink_type=flow
).Result arrow files (basin, flow and concentration) are read with pandas and indexed on time (concentration is widened first) and saved on the widget. Fields on the BasinNode and FlowLink are created to store the result variables. A specific time slice, by default the last, or by a signal from the temporal manager is then used to update these fields. The temporal manager is initialized based on the start/endtime and timestep from .toml file.
In effect you now have Node and Link tables with all result variables for a given timestep, meaning you're free to add symbology/labels as you would for any (static) layer.
The layer context menu is expanded to show a "Show topology" checkmark, which sets a layer variable, which in turn is used by the layer symbology to either show
@geometry
ormake_line(start_point(@geometry), end_point( @geometry))
.For @Huite and @JoerivanEngelen, updating the (memory) layers on the fly, and not using QGIS to read arrow files is essential for performance. Further performance was gained by not iterating over the layer features and updating them, but by setting them directly based on the fid (order). Note that the memory copy does not use the same fids as our geopackage layers, and you can't control them. The last factor of performance was disabling the automatic undo functionality (or rather creating 1 undo, instead of one for each feature) when updating the layer.