-
Notifications
You must be signed in to change notification settings - Fork 29
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
Easier customization of the _label in wastewater_structure table #524
Comments
I think we have several approaches here:
Of course, my preference goes to 3b, but this approach requires some testing to be sure it's fully applicable. |
I prefer also 3.
The identifier must of course not be predefined. Other suggestion: I prefer to label only in-/out-levels of pwwf-channels. I changed therefore the update_wastewater_structure_label-script: WHERE (_all OR NE.fk_wastewater_structure = _obj_id) and CH_to.function_hierarchic in (5062,5064,5066,5068,5069,5070,5071,5072,5074) ----label only reaches with function_hierarchic=pwwf.* |
I also prefer 3, especially 3b because it is really flexible and almost fully answers our needs (except the possibility to choose the calculation method for inputs and outputs order. By the way, could you confirm that the inputs are ordered clockwise from the output reach orientation in the model ? |
If the pre-formatted strings are separate for cover, in and out, then the replace-solution is quit easy because there are no other letters than C, I and O in every of these strings. _depth already exists. So we have to add fields _labelcover, _labelin, _labelout (text fields) and _bottom (numeric 6,3). |
How about the following proposal (pretty much like @3nids suggested). Adding fields (that can eventually replace the current label field) for the "complex" parts only.
The demo project will then be preconfigured with an expression that concatenates these parts and replaces the english default prefixes. Please add 👍 to this post if you like it or 👎 if you don't like it |
Possibly something to consider in the same sprint #9 |
Should we leave |
@urskaufmann @ponceta Are you able to test and review the proposed fix for this ? Delta for the schema : delta_1.5.0_labelling.sql |
@olivierdalang can you have a look at the numbering (E2, E4, ...) and the qgep_wastewater_structure view? For the rest, let's have a look at the sprint 👍 |
I added the fields to the view creation script, so normally you'd have them if you do a normal pum upgrade (and not just run the delta I provided).
Indeed, it seems reaches without level were counted but not displayed. Instead of just skipping them, wouldn't it be better to display |
That would be it : https://raw.githubusercontent.com/olivierdalang/datamodel/524_labelling/delta/delta_1.5.0_labelling.sql |
3 more fixes to add :
|
After in depth inspection with Urs, it seems the order of inputs/ouputs in the label is computed correctly. The issues is due to the demo data, where there's a mess around special structures. It is automatically with the reach update trigger... So it's probably worth running that trigger on the whole table to fix the data ? |
order of inputs/outputs accord to angle doesn't work properly: The angle is now calculated with the first or last percent of the reach. This works not in all cases. |
I would not deprecate the _label attribute if possible! It is useful and makes sense to have an aggregation already set. The cost per transaction does not seems too high to me? |
@ponceta You're right about cost per transaction, it's probably negligible. It's more about avoiding duplication (in the code, the docs, the future bugs, etc...). As far as I understood, currently, there's no backwards compatibility policy with QGEP, so that users should anyways update their QGIS project when changing datamodel version. And if we think deprecating it later, then we're just as good doing it today, as it won't cause less trouble later :-) |
@olivierdalang I'm doing some test with version 1.5 and the fields _bottom_level_label, _input_label and _output_label don't get updated when I update the corresping data.. But _cover_level_label does get updated. Does it work for you? |
@varrieta That's strange ! It works here and the functionality is covered by automatic tests... so there may be something unexpected going on. Are the labels correctly updated before your update to 1.5.x ? (also you wrote |
Not sure, I didn't use the functionality before. I'll try and let you know. It is really strange because it works for the cover..
No it is updated but the label not generated
Yes just a typo sorry |
How can I manually run this function: |
Have you tried |
@DflGruBoe Can you test whether it does what you want? The query itself runs on my system, but I cannot check whether it solves your problem. |
See also #601 |
Please reopen if still an issue |
As I understand, _label attribute in wastewater_structure table is generated on database side through a trigger (or manually) with the general function called update_wastewater_structure_label. Modifying manually the function in the model is not an option in my opinion because it cout be forgotten during model upgrades.
We would like to get more control on how this _label is written, such as:
The text was updated successfully, but these errors were encountered: