Refine
This commit is contained in:
@@ -68,14 +68,15 @@ def get_pipe_risk_probability_geometries(name: str) -> dict[str, Any]:
|
|||||||
key_geometry = 'geometry'
|
key_geometry = 'geometry'
|
||||||
|
|
||||||
with conn[name].cursor(row_factory=dict_row) as cur:
|
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 record in cur:
|
||||||
for col in record:
|
for col in record:
|
||||||
print(col)
|
print(col)
|
||||||
|
|
||||||
id = record[key_pipeId]
|
id = record[key_pipeId]
|
||||||
geom = json.loads(record[key_geometry])
|
geom = json.loads(ST_AsGeoJSON(record[key_geometry]))
|
||||||
|
|
||||||
pipe_risk_probability_geometries[id] = {
|
pipe_risk_probability_geometries[id] = {
|
||||||
'start': geom['coordinates'][0],
|
'start': geom['coordinates'][0],
|
||||||
|
|||||||
Reference in New Issue
Block a user