fix(sensor): use published coordinates for custom SRIDs
Generic Container CI/CD / test-build-publish (push) Successful in 2m11s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 2m11s

Result validation bypassed the project-specific GIS transform and called ST_Transform on custom engineering SRIDs. Read project and map coordinates from gis.junctions so every project uses its configured publication transform.
This commit is contained in:
2026-09-11 11:29:51 +08:00
parent 90b02057bc
commit 0685f6dd17
2 changed files with 16 additions and 14 deletions
+10 -11
View File
@@ -130,18 +130,17 @@ def get_sensor_placement_nodes(
) AS incident_pipes
GROUP BY node_id
)
SELECT j.node_id,
SELECT g.id AS node_id,
ipd.max_pipe_diameter,
j.elevation,
ST_X(g.geom) AS project_x,
ST_Y(g.geom) AS project_y,
ST_X(ST_Transform(g.geom, 3857)) AS map_x,
ST_Y(ST_Transform(g.geom, 3857)) AS map_y
FROM network.junctions AS j
JOIN gis.node_geometries AS g ON g.node_id = j.node_id
LEFT JOIN incident_pipe_diameters AS ipd ON ipd.node_id = j.node_id
WHERE j.node_id = ANY(%s)
ORDER BY j.node_id
g.elevation,
g.x AS project_x,
g.y AS project_y,
ST_X(g.geom) AS map_x,
ST_Y(g.geom) AS map_y
FROM gis.junctions AS g
LEFT JOIN incident_pipe_diameters AS ipd ON ipd.node_id = g.id
WHERE g.id = ANY(%s)
ORDER BY g.id
""",
(node_ids, node_ids, node_ids),
)