Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend implementation for multiple feature selection within single form submission #1800

Open
3 tasks done
spwoodcock opened this issue Sep 21, 2024 · 4 comments
Open
3 tasks done
Assignees
Labels
effort:low Likely a few hours enhancement New feature or request frontend Related to frontend code priority:high Should be addressed as a priority testing:fail Failed testing

Comments

@spwoodcock
Copy link
Member

spwoodcock commented Sep 21, 2024

Is your feature request related to a problem? Please describe.

Follow on from #1653, as the frontend implementation.

Related #1792 #1799

Issue was described across these links, but consolidating info here.

Describe the solution you'd like

During project creation we need:

  • update frontend to allow uploading supplementary geojson geometries
    image
    • There should be an additional button 'Upload Additional Features'.
    • It should use a checkbox, with the upload field hidden until the box is checked. Similar to the custom XLSForm upload.
    • It would probably be good if we can validate the GeoJSON file, in similar way that we validate the AOI area upload (probably not requiring backend).
    • The GeoJSON data and filename (without extension) should be saved in frontend state.
  • On the final project submit we need to call the /projects/{project_id}/additional-entity endpoint, passing in the GeoJSON file as form data. It should be called after task areas have been created (via API call) and data extract uploaded (via API call), but before the /generate-project-data endpoint is called (this will create the Entity list).
    • The param for the API is geojson.
  • Pass the filename (without file extension) as the additional_entities param on /generate-project-data.
    • This is a list, so would be additional_entities: [GEOJSON_FILENAME_WITHOUT_EXTENSION].
    • The endpoint should receive the additional list and inject variables into the XLSForm so the user has a question to select the geometry.
@spwoodcock
Copy link
Member Author

@manjitapandey this is the final part for the Tokha project requirement 😄

@manjitapandey
Copy link
Collaborator

unable to create projects with multiple map features.
Steps to reproduce:

  1. upload buildings as custom map feature.
  2. click on additional map feature and upload road data.
  3. use task splitting algorithm and submit.
  4. see error in project creation.

500 error is encountered on https://api.stage.fmtm.hotosm.org/projects/47/additional-entity api.

@manjitapandey
Copy link
Collaborator

This feature is functional if we upload point, line and polygon however, there is an errror in case user uploads multiline string as additional features.

@spwoodcock
Copy link
Member Author

spwoodcock commented Oct 1, 2024

Good info!

Perhaps we can pass the geogjson through our processors to strip out multi-geom types in FMTM? (in postgis_utils.py` I believe)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:low Likely a few hours enhancement New feature or request frontend Related to frontend code priority:high Should be addressed as a priority testing:fail Failed testing
Projects
Development

No branches or pull requests

4 participants