Skip to content

Commit

Permalink
refactor: revert to use geom_type assignment expression
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Jan 19, 2024
1 parent bd9c4ab commit 3c9d03c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,13 @@ async def get_data_extract_url(
}
}

if aoi.get("type") == "FeatureCollection":
if geom_type := aoi.get("type") == "FeatureCollection":
# Convert each feature into a Shapely geometry
geometries = [
shape(feature.get("geometry")) for feature in aoi.get("features", [])
]
merged_geom = unary_union(geometries)
elif aoi.get("type") == "Feature":
elif geom_type == "Feature":
merged_geom = shape(aoi.get("geometry"))
else:
merged_geom = shape(aoi)
Expand Down

0 comments on commit 3c9d03c

Please sign in to comment.