From a91442c51ead1bedc7c16d19b8aa3a39a1b82ea1 Mon Sep 17 00:00:00 2001 From: sujanadh Date: Thu, 12 Oct 2023 15:07:34 +0545 Subject: [PATCH 1/3] fix: issue when single feature polygon uploaded to upload multi polygon api --- src/backend/app/projects/project_crud.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 693eadea73..07f4d2f155 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -402,7 +402,10 @@ def update_multi_polygon_project_boundary( return False # Update the boundary polyon on the database. - polygons = boundary["features"] + if boundary["type"]=="Feature": + polygons = [boundary] + else: + polygons = boundary["features"] log.debug(f"Processing {len(polygons)} task geometries") for polygon in polygons: # If the polygon is a MultiPolygon, convert it to a Polygon From ca6409a7c119f39d4745aadac0d3e2fefb7051ec Mon Sep 17 00:00:00 2001 From: sujanadh Date: Thu, 12 Oct 2023 15:30:23 +0545 Subject: [PATCH 2/3] fix: solved tasking splitting issue --- src/backend/app/projects/project_crud.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 07f4d2f155..596d6b2733 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -772,7 +772,6 @@ def split_polygon_into_tasks( ) return [] - features = json.loads(features) log.debug(f"Project {project_id} split into {len(features)} tasks") return features From e666f145281fc0f2f54ad4266a93f6d0be7283aa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:55:32 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/backend/app/projects/project_crud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 596d6b2733..6bf8d1f7c5 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -402,7 +402,7 @@ def update_multi_polygon_project_boundary( return False # Update the boundary polyon on the database. - if boundary["type"]=="Feature": + if boundary["type"] == "Feature": polygons = [boundary] else: polygons = boundary["features"]