From 53a4b732f6c0b630747d70f78f1789d652293ae0 Mon Sep 17 00:00:00 2001 From: Pradip-p Date: Sat, 13 Jul 2024 13:51:06 +0545 Subject: [PATCH] feat: added multipolygon_to_polygon in no_fly_zones --- src/backend/app/projects/project_schemas.py | 3 ++- src/backend/app/utils.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/app/projects/project_schemas.py b/src/backend/app/projects/project_schemas.py index 6904b2cd..57ea986e 100644 --- a/src/backend/app/projects/project_schemas.py +++ b/src/backend/app/projects/project_schemas.py @@ -8,6 +8,7 @@ from app.utils import ( geojson_to_geometry, + multipolygon_to_polygon, read_wkb, merge_multipolygon, str_to_geojson, @@ -52,7 +53,7 @@ def no_fly_zones(self) -> Optional[Any]: if not self.outline_no_fly_zones: return None - outline = merge_multipolygon(self.outline_no_fly_zones) + outline = multipolygon_to_polygon(self.outline_no_fly_zones) return geojson_to_geometry(outline) @computed_field diff --git a/src/backend/app/utils.py b/src/backend/app/utils.py index 2a9cea56..2623aaf8 100644 --- a/src/backend/app/utils.py +++ b/src/backend/app/utils.py @@ -1,5 +1,6 @@ import logging import geojson +from geojson import Feature import requests import shapely from datetime import datetime, timezone