Refine
This commit is contained in:
@@ -71,9 +71,6 @@ def get_pipe_risk_probability_geometries(name: str) -> dict[str, Any]:
|
|||||||
cur.execute(f"select *, ST_AsGeoJSON(geometry) AS {key_geometry} from gis_pipe")
|
cur.execute(f"select *, ST_AsGeoJSON(geometry) AS {key_geometry} from gis_pipe")
|
||||||
|
|
||||||
for record in cur:
|
for record in cur:
|
||||||
for col in record:
|
|
||||||
print(col)
|
|
||||||
|
|
||||||
id = record[key_pipeId]
|
id = record[key_pipeId]
|
||||||
geom = json.loads(record[key_geometry])
|
geom = json.loads(record[key_geometry])
|
||||||
|
|
||||||
@@ -82,6 +79,10 @@ def get_pipe_risk_probability_geometries(name: str) -> dict[str, Any]:
|
|||||||
'end': geom['coordinates'][1]
|
'end': geom['coordinates'][1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for col in record:
|
||||||
|
if col != key_pipeId and col != key_geometry:
|
||||||
|
pipe_risk_probability_geometries[id][col] = record[col]
|
||||||
|
|
||||||
# print(len(pipe_risk_probability_geometries))
|
# print(len(pipe_risk_probability_geometries))
|
||||||
|
|
||||||
return pipe_risk_probability_geometries
|
return pipe_risk_probability_geometries
|
||||||
Reference in New Issue
Block a user