From 355aff61b90b4649d5a707ac8f9689ae1f428726 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Sun, 20 Apr 2025 10:01:07 +0800 Subject: [PATCH] Refine --- api/s41_pipe_risk_probability.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/s41_pipe_risk_probability.py b/api/s41_pipe_risk_probability.py index 5ccc8d8..f5eb771 100644 --- a/api/s41_pipe_risk_probability.py +++ b/api/s41_pipe_risk_probability.py @@ -68,14 +68,15 @@ def get_pipe_risk_probability_geometries(name: str) -> dict[str, Any]: key_geometry = 'geometry' with conn[name].cursor(row_factory=dict_row) as cur: - cur.execute(f"select {key_pipeId}, ST_AsGeoJSON(geometry) AS {key_geometry} from gis_pipe") + #cur.execute(f"select {key_pipeId}, ST_AsGeoJSON(geometry) AS {key_geometry} from gis_pipe") + cur.execute(f"select * from gis_pipe") for record in cur: for col in record: print(col) id = record[key_pipeId] - geom = json.loads(record[key_geometry]) + geom = json.loads(ST_AsGeoJSON(record[key_geometry])) pipe_risk_probability_geometries[id] = { 'start': geom['coordinates'][0],