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

Prevent view crashing if ST_LENGTH(re.progression3d_geometry) is null or 0 #544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rbovard
Copy link

@rbovard rbovard commented Feb 11, 2025

No description provided.

@cymed
Copy link
Contributor

cymed commented Feb 13, 2025

In what situation do you need to digitise a reach with a length of 0 m?

Also I feel like using a coalesce will be quicker in production

@sjib
Copy link
Contributor

sjib commented Feb 13, 2025

Thank you for this improvement.

I think it is good if this case of length = 0 m is treated and does not create a crash of the plugin (mistakes can happen or we import data from another system and then have such cases - I have seen a lot of cases that you never thought about in the last 20 years).
@rbovard Maybe a warning could be added for length = 0 - this would help to find such cases easily

@rbovard
Copy link
Author

rbovard commented Feb 13, 2025

That's it, if you import data from external sources it makes the view crash.

@cymed The error is division by zero, so we need to check if the value is >0 (not only not null with COALESCE no?)

@sjib What do yo mean about this warning? You want me do something in this PR?

@sjib
Copy link
Contributor

sjib commented Feb 13, 2025

@rbovard This adaption of the view is maybe not the best place to add a warning. But we have similar issues with the length profile. So thinking where to add a check and what especially it should highlight on this might be a good thing. Can you create an extra issue?

@rbovard
Copy link
Author

rbovard commented Feb 13, 2025

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants