Skip to content

Commit

Permalink
update raw query issue in upload multipolygon
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Sep 5, 2023
1 parent c4dd341 commit 1074137
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from sqlalchemy import and_, column, func, inspect, select, table
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy.orm import Session
from sqlalchemy import text
from sqlalchemy.sql import text
from cpuinfo import get_cpu_info
from ..db import database
Expand Down Expand Up @@ -436,14 +437,13 @@ def remove_z_dimension(coord):
)
db.commit()



# Generate project outline from tasks
# query = f'''SELECT ST_AsText(ST_Buffer(ST_Union(outline), 0.5, 'endcap=round')) as oval_envelope
# FROM tasks
# where project_id={project_id};'''
query = text(f"""SELECT ST_AsText(ST_ConvexHull(ST_Collect(outline)))
FROM tasks
WHERE project_id={project_id};""")

query = f"""SELECT ST_AsText(ST_ConvexHull(ST_Collect(outline)))
FROM tasks
WHERE project_id={project_id};"""
log.debug("Generating project outline from tasks")
result = db.execute(query)
data = result.fetchone()
Expand Down

0 comments on commit 1074137

Please sign in to comment.