nens / threedi-api-qgis-client

3Di Models & Simulations plugin
https://plugins.lizard.net/
Other
2 stars 0 forks source link

Simulation wizard: Improve UX for selecting breaches #440

Open leendertvanwolfswinkel opened 1 year ago

leendertvanwolfswinkel commented 1 year ago

User stories

Which flowlines are valid and relevant as breach Valid: all flowlines with KCU type / line type 51, 52, 53, 54, and 55 are breachable. Relevant:

UX In the Simulation Wizard, Breaches page, there should be the following options to select a breach:

Technical consequences The simulation wizard will need to have access to the breaches and the flowlines. These could be downloaded as GeoJSON, or the gridadmin geopackage could be used for this. I propose to download the gridadmin GPKG (to its proper location in the directory structure, i.e. /bla/bla/grid/gridadmin.gpkg) and use the layers from there. This would also require that exporting breaches is added to the "export to geopackage" function of threedigrid.

API call The endpoint /v3/simulations/{simulation_pk}/events/breaches/ has changed: a parameter line_id has been added. This should now be used instead of the potential_breach parameter (which is still there for backward compatibility only). The line_id is the id of a line in the gridadmin.

leendertvanwolfswinkel commented 1 year ago

@Jonasvsl @caspervdw feedback please :)

caspervdw commented 1 year ago

This sounds good! Getting the breaches/flowlines from the gridadmin is indeed the best option.

Jonasvsl commented 1 year ago

@leendertvanwolfswinkel

This is relevant enough to have it as a possibility. It is not the most common thing to do, but in case someone wants this we do not want to chase them towards scripting

Other remarks:

caspervdw commented 1 year ago

This is relevant enough to have it as a possibility. It is not the most common thing to do, but in case someone wants this we do not want to chase them towards scripting

It is perfectly find to open multiple breaches (backend places no constraints on this)

Do potential breaches based on a exchange line have a display or code name?

No

leendertvanwolfswinkel commented 1 year ago

Duration till max depth -> Duration until maximum breach depth

ldebek commented 1 week ago

@leendertvanwolfswinkel @Overmeen Few questions/request to wrap new UX functionality:

  1. Is layer with Breach objects already included in gridadmin.gpkg file? If so - could you please provide me an example model with them (couldn't find such so far)
  2. Which fields from the Flowline layer should I use to populate ID of the breach, suration till max depth, discharge coefficients, initial width and max breach depth?
  3. While selecting multiple breaches - should it be possible to select them via Breach ID combobox as well?
  4. While selecting multiple breaches - should it be possible to select features from both source layers - Breachand Flowline layers?
leendertvanwolfswinkel commented 3 days ago

ID of the breach, --> source_table_id in the flowline layer = id in schematisation = content_pk in the geojson (To get the potential breach from the geojson use the content_pk parameter to filter the potential breaches endpoint: /potential_breaches/?connected_pnt_id={content_pk}) duration till max depth --> same logic as currently implemented, i.e. fetch from simulation template if applicable discharge coefficients --> same logic as currently implemented, i.e. fetch from simulation template if applicable initial width --> same logic as currently implemented, i.e. fetch from simulation template if applicable max breach depth --> if it is in the simulation template, fetch it from there. otherwise, you have the option to use the api to get this value (maximum_breach_depth via the /v3/threedimodels/{threedimodel_pk}/potentialbreaches/ endpoint) OR use threedigrid to get the levbr attribute from the breaches

Is layer with Breach objects already included in gridadmin.gpkg file? If so - could you please provide me an example model with them (couldn't find such so far)

The breaches are in the layer "flowline", filter on line_type=55

Which fields from the Flowline layer should I use to populate ID of the breach, duration till max depth, discharge coefficients, initial width and max breach depth?

While selecting multiple breaches - should it be possible to select them via Breach ID combobox as well?

Yes

While selecting multiple breaches - should it be possible to select features from both source layers - Breach and Flowline layers?

As mentioned above, the breaches are a subset of Flowlines (with line_type=55). So I think we can use a single layer and only change the the behaviour of the map tool as in the criteria it uses to select/ignore a feature?