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

Add status to automatically created nodes #392

Open
rbovard opened this issue Dec 11, 2024 · 0 comments
Open

Add status to automatically created nodes #392

rbovard opened this issue Dec 11, 2024 · 0 comments

Comments

@rbovard
Copy link
Contributor

rbovard commented Dec 11, 2024

Currently, each pipe has a node at both of its ends.

The problem is that if we want to display the node layer with only the pipes that are in service, it’s not possible because the pipe's status is not associated with the node. This leads to strange visual outputs like the one shown here:

image

image

image

Would it be possible to implement a mechanism to transfer the pipe’s status to the node? Currently, it’s not possible to delete nodes because they are referenced in non-nullable fields of the pipes.

I wrote this query to list all the nodes that are only connected to pipes that are not in service (i.e., if a node touches both an in-service pipe and an out-of-service pipe, it is not included). However, it would also be worth considering a hierarchy of statuses to determine which one should take precedence over the others.

SELECT n.*
FROM qwat_od.node n
WHERE EXISTS (
    SELECT 1
    FROM qwat_od.pipe p
    WHERE ST_Touches(n.geometry, p.geometry)
      AND p.fk_status IN (1302, 1303, 1304, 1305)
)
AND NOT EXISTS (
    SELECT 1
    FROM qwat_od.pipe p
    WHERE ST_Touches(n.geometry, p.geometry)
      AND p.fk_status NOT IN (1302, 1303, 1304, 1305)
);
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

No branches or pull requests

1 participant