Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development'
Browse files Browse the repository at this point in the history
Merge dev branch into main
  • Loading branch information
rsavoye committed Jul 19, 2023
2 parents 7d276e5 + eb77957 commit f3da1ee
Show file tree
Hide file tree
Showing 20 changed files with 989 additions and 346 deletions.
1 change: 1 addition & 0 deletions src/backend/app/db/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ def tasks_bad(self):
form_xls = Column(LargeBinary) # XLSForm file if custom xls is uploaded
data_extract_type = Column(String) # Type of data extract (Polygon or Centroid)
task_split_type = Column(String) # Type of split (Grid or Feature)
hashtags = Column(ARRAY(String)) # Project hashtag

# TODO: Add index on project geometry, tried to add in __table args__
# Index("idx_geometry", DbProject.geometry, postgresql_using="gist")
Expand Down
3 changes: 2 additions & 1 deletion src/backend/app/db/postgis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ def timestamp():
return datetime.datetime.utcnow()


def geometry_to_geojson(geometry: Geometry, properties: str = {}):
def geometry_to_geojson(geometry: Geometry, properties: str = {}, id: int = None):
if geometry:
shape = to_shape(geometry)
geojson = {
"type": "Feature",
"geometry": mapping(shape),
"properties": properties,
"id": id,
}
return Feature(**geojson)

Expand Down
Loading

0 comments on commit f3da1ee

Please sign in to comment.