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

Fix Campagne 6ef8bf4c-8db3-4276-a42c-443660b074af qui fait bugger le script bi_pipeline #31

Open
charlesollion opened this issue Jun 1, 2023 · 2 comments
Assignees

Comments

@charlesollion
Copy link
Contributor

No description provided.

@charlesollion
Copy link
Contributor Author

charlesollion commented Jun 1, 2023

L'erreur en question est : GEOSBuffer: TopologyException: No forward edges found in buffer subgraph

En modifiant le buffer de 200 à 50 comme si dessous, l'erreur disparaît.

SELECT sub.id, sub.the_geom,
   st_union(st_buffer(the_geom_monitored, 50)) AS the_geom_monitored,
   count(id_ref_campaign_fk) nb_campaign
FROM (
    SELECT
        r.id,
        tp_river.id_ref_campaign_fk,
        ST_Simplify(st_makevalid(
            st_makeline(
                tp_river.the_geom
                ORDER BY tp_river.time
            )
        ), 1, true) AS the_geom_monitored,
        r.the_geom
    FROM bi_temp.trajectory_point_river tp_river
        INNER JOIN referential.river r ON r.id = tp_river.id_ref_river_fk
    WHERE r.id = 3264
    GROUP BY r.id, tp_river.id_ref_campaign_fk
) sub
GROUP BY sub.id, sub.the_geom

Quel est l'intérêt des polygones monitorés aujourd'hui ?

@charlesollion
Copy link
Contributor Author

Une meilleure version pour conserver le comportement et le rayon de 200 découper en 2 st_buffers, un premier qui ne fail jamais puis un second qui permet d'avoir le bon rayon.

    SELECT
        r.id,
        tp_river.id_ref_campaign_fk,
        st_buffer(st_buffer(ST_Simplify(st_makevalid(
            st_makeline(
                tp_river.the_geom
                ORDER BY tp_river.time
            )
        ), 1, true), 2), 198) AS the_geom_monitored,
        r.the_geom
    FROM bi_temp.trajectory_point_river tp_river
        INNER JOIN referential.river r ON r.id = tp_river.id_ref_river_fk
    WHERE r.id = 3264-- and tp_river.id_ref_campaign_fk = '6ef8bf4c-8db3-4276-a42c-443660b074af'
    GROUP BY r.id, tp_river.id_ref_campaign_fk

@charlesollion charlesollion self-assigned this Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant