Skip to content

Commit

Permalink
fix: task split algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Sep 6, 2023
1 parent 0a2e52c commit b44be94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,15 +700,15 @@ def process_polygon(db:Session, project_id:uuid.UUID, boundary_data:str, no_of_b
db.commit()
else:
# Remove the polygons outside of the project AOI using a parameterized query
query = f"""
query = text(f"""
DELETE FROM ways_poly
WHERE NOT ST_Within(ST_Centroid(ways_poly.geom), (SELECT geom FROM project_aoi WHERE project_id = '{project_id}'));
"""
""")
result = db.execute(query)
db.commit()
with open('app/db/split_algorithm.sql', 'r') as sql_file:
query = sql_file.read()
result = db.execute(query, params={'num_buildings': no_of_buildings})
result = db.execute(text(query), params={'num_buildings': no_of_buildings})
result = result.fetchall()
db.query(db_models.DbBuildings).delete()
db.query(db_models.DbOsmLines).delete()
Expand Down

0 comments on commit b44be94

Please sign in to comment.