Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinaHutter committed Apr 5, 2024
1 parent 7b55b5b commit 0d53be3
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,17 @@ def aggregate_spatial(
if "properties" not in feature:
feature["properties"] = {}
elif feature["properties"] is None:
feature["properties"] = {}
feature["properties"] = {}
if isinstance(geometries.get("crs", {}), dict):
DEFAULT_CRS = (
geometries.get("crs", {}).get("properties", {}).get("name", DEFAULT_CRS)
geometries.get("crs", {})
.get("properties", {})
.get("name", DEFAULT_CRS)
)
else:
DEFAULT_CRS = int(geometries.get("crs", {}))
logger.info(f"CRS in geometries: {DEFAULT_CRS}.")

if "type" in geometries and geometries["type"] == "FeatureCollection":
gdf = gpd.GeoDataFrame.from_features(geometries, crs=DEFAULT_CRS)
elif "type" in geometries and geometries["type"] in ["Polygon"]:
Expand Down

0 comments on commit 0d53be3

Please sign in to comment.