Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/hotosm/fmtm into dev…
Browse files Browse the repository at this point in the history
…elopment
  • Loading branch information
spwoodcock committed Jan 10, 2024
2 parents d60614b + 62bc231 commit 71066f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/components/createnewproject/DataExtract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 71066f8

Please sign in to comment.