diff --git a/src/backend/app/projects/project_crud.py b/src/backend/app/projects/project_crud.py index 0d9bd351c6..b1cdbbb971 100644 --- a/src/backend/app/projects/project_crud.py +++ b/src/backend/app/projects/project_crud.py @@ -2337,8 +2337,14 @@ def is_valid_coordinate(coord): ) if geometry_type == "MultiPolygon": first_coordinate = ( - coordinates[0][0][0] if coordinates and coordinates[0] else None + coordinates[0][0] if coordinates and coordinates[0] else None ) + elif geometry_type == "Point": + first_coordinate = coordinates if coordinates else None + + elif geometry_type == "LineString": + first_coordinate = coordinates[0] if coordinates else None + else: first_coordinate = coordinates[0][0] if coordinates else None diff --git a/src/backend/app/projects/project_routes.py b/src/backend/app/projects/project_routes.py index b24a96bb0b..c5a3dede87 100644 --- a/src/backend/app/projects/project_routes.py +++ b/src/backend/app/projects/project_routes.py @@ -434,6 +434,7 @@ async def task_split( # read data extract parsed_extract = geojson.loads(await extract_geojson.read()) + check_crs(parsed_extract) return await project_crud.split_geojson_into_tasks( diff --git a/src/frontend/src/components/createnewproject/DataExtract.tsx b/src/frontend/src/components/createnewproject/DataExtract.tsx index 161e4aac08..42e57c2a85 100644 --- a/src/frontend/src/components/createnewproject/DataExtract.tsx +++ b/src/frontend/src/components/createnewproject/DataExtract.tsx @@ -67,7 +67,7 @@ const DataExtract = ({ flag, customLineUpload, setCustomLineUpload, customPolygo const uint8ArrayData = new Uint8Array(binaryData); // Deserialize the binary data const geojsonExtract = await fgbGeojson.deserialize(uint8ArrayData); - dispatch(CreateProjectActions.setDataExtractGeojson(geojsonExtract)); + await dispatch(CreateProjectActions.setDataExtractGeojson(geojsonExtract)); } catch (error) { // TODO add error message for user console.error('Error getting data extract:', error); @@ -134,7 +134,7 @@ const DataExtract = ({ flag, customLineUpload, setCustomLineUpload, customPolygo } // View on map - dispatch(CreateProjectActions.setDataExtractGeojson(extractFeatCol)); + await dispatch(CreateProjectActions.setDataExtractGeojson(extractFeatCol)); }; const resetFile = (setDataExtractToState) => {