fix(sensor): use published coordinates for custom SRIDs
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:
@@ -122,7 +122,7 @@ def test_list_sensor_placements_batches_node_lookup(monkeypatch):
|
||||
assert [len(run["sensor_points"]) for run in runs] == [2, 2]
|
||||
|
||||
|
||||
def test_sensor_nodes_query_uses_new_network_and_gis_schemas(monkeypatch):
|
||||
def test_sensor_nodes_query_uses_published_junction_coordinates(monkeypatch):
|
||||
cursor = _mock_project_cursor(monkeypatch)
|
||||
cursor.fetchall.return_value = []
|
||||
|
||||
@@ -131,8 +131,11 @@ def test_sensor_nodes_query_uses_new_network_and_gis_schemas(monkeypatch):
|
||||
query = cursor.execute.call_args.args[0]
|
||||
assert "network.pipes" in query
|
||||
assert "network.links" in query
|
||||
assert "gis.node_geometries" in query
|
||||
assert "ST_Transform(g.geom, 3857)" in query
|
||||
assert "FROM gis.junctions AS g" in query
|
||||
assert "g.x AS project_x" in query
|
||||
assert "ST_X(g.geom) AS map_x" in query
|
||||
assert "gis.node_geometries" not in query
|
||||
assert "ST_Transform" not in query
|
||||
assert "l.start_node_id = ANY(%s)" in query
|
||||
assert "l.end_node_id = ANY(%s)" in query
|
||||
assert "CROSS JOIN LATERAL" not in query
|
||||
|
||||
Reference in New Issue
Block a user