Skip to content

Commit

Permalink
fix: replace iterative approach for task feats, edit schema
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Oct 25, 2023
1 parent 4eeee31 commit 9c9be14
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
19 changes: 0 additions & 19 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,25 +685,6 @@ def get_project_features(
feature(json): JSON object containing a list of features
"""
features = project_crud.get_project_features(db, project_id, task_id)
# Simplify the geojson to send (strip project_id & task_id to reduce size)
# TODO coordinate with frontend to remove the first level geometry key
# Only return geojson with properties:
# {'type': 'feature', 'geometry': {...}, 'properties': {...}}
features = [
{
"id": feature["id"],
"geometry": {
"id": feature["geometry"]["id"],
"type": feature["geometry"]["type"],
"geometry": feature["geometry"]["geometry"],
"properties": {
"id": feature["geometry"]["properties"]["id"],
"building": feature["geometry"]["properties"]["building"],
},
},
}
for feature in features
]
return features


Expand Down
2 changes: 0 additions & 2 deletions src/backend/app/projects/project_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class BETAProjectUpload(BaseModel):

class Feature(BaseModel):
id: int
project_id: int
task_id: Optional[int] = None
geometry: Optional[GeojsonFeature] = None


Expand Down

0 comments on commit 9c9be14

Please sign in to comment.