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

Add extra project advanced config option for new point collection: point, polygon, polyline #1979

Closed
5 tasks done
spwoodcock opened this issue Dec 11, 2024 · 17 comments
Closed
5 tasks done
Assignees
Labels
backend Related to backend code effort:medium Likely a day or two enhancement New feature or request frontend Related to frontend code

Comments

@spwoodcock
Copy link
Member

spwoodcock commented Dec 11, 2024

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

  • We can currently add a new point in FMTM and have it injected as the new_feature field in the XLSForm.
  • The XLSForm field is currently geopoint.
  • Ideally we can have this configurable, so we inject the field as geotrace (polygon) or geoshape (polygon), and allow the user to draw the relevant geometry in FMTM to inject.

This is a follow up issue from #1915

Describe the solution you'd like

  • Add a config option for this during project creation (frontend, the backend accepts the param)
  • Add a db field for projects to capture this, as an enum with three options **edit: done, added field new_geom_type with enum options POINT, POLYLINE, POLYGON.
  • Based on the enum value in the project JSON in the frontend, we change the terradraw geom type: point, polyline, polygon.
  • We may need to add buttons for deleting and modifying vertices if drawing more complex polygons.
  • The append_mandatory_fields function in osm-fieldwork should have the option to specify the new geom type, so the XLSForm has the relevant field type. Allow the XLSForm new_feature question geometry type to be configurable osm-fieldwork#329 (released in v0.18.0)

Additional context

  • This may be dependent on moving the mandatory XLSForm questions sheet out of the XLS file and directly into code (to make things easier).
@spwoodcock spwoodcock added backend Related to backend code effort:medium Likely a day or two enhancement New feature or request frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time labels Dec 11, 2024
@manjitapandey
Copy link
Contributor

We can currently add a new point in FMTM and have it injected as the new_feature field in the XLSForm.

Is this new_feature becomes an entity and can we use it in visualising the bad submissions??

cc: @spwoodcock , @Sujanadh

@spwoodcock
Copy link
Member Author

Yes we can for sure!

Either:

  • Make an API call to get entity ids and statuses. Then fetch the geoms via their entity id.

  • (preferred) insert the new geoms and bad geoms into an FMTM database table. Have the table reactive via electric again. The geometries will be loaded on the map real time as they are mapped or marked bad.

@manjitapandey
Copy link
Contributor

What is the next step in this issue? Is it ready for testing or few things are still remaining?
cc: @Sujanadh

@spwoodcock
Copy link
Member Author

I'm working on it - ticking off the tasks in the description as they are done

@manjitapandey
Copy link
Contributor

@spwoodcock Does this needs frontend side of action now?? I am not sure as i am not being able to draw new polygon on FMTM mapper's page.
cc: @NSUWAL123

@spwoodcock
Copy link
Member Author

@spwoodcock Does this needs frontend side of action now?? I am not sure as i am not being able to draw new polygon on FMTM mapper's page.
cc: @NSUWAL123

If you create a new project, it will default to polygons.

Existing projects are point projects.

We don't have a way to specify this during project creation, but its not a problem for now, as I imagine most want polygons (can address that later)

@manjitapandey
Copy link
Contributor

Thanks, this clarification helps me in testing.

@manjitapandey
Copy link
Contributor

I am not finding the current frontend part intuitive. When I click on map new feature and click on map to draw, I am not confident on number of clicks i need to redirect to odk for form submissions. Sometimes, I am redirected to odk when only two nodes are drawn and sometimes I am not able to go to odk even after feature drawing is completed, rather it keeps editing the feature.

cc: @NSUWAL123 can you verify the behavior??

@spwoodcock
Copy link
Member Author

spwoodcock commented Jan 16, 2025

Hmm yes its very flaky on mobile!

There is a lot of interference from existing click events.

Perhaps when we are in draw mode, we can disable the click event for the rest of the map temporarily? (might be tricky)

Or another approach could be opening a popup map for drawing the new geom specifically (not ideal, but we could remove all the other click handlers in this case)

@spwoodcock
Copy link
Member Author

The intended functionality can be tested on mobile here: https://terradraw.io/

You click to click an existing vertice for drawing to stop, which isn't super intuitive.

Perhaps we also need a button in place for the user to 'Confirm' the geometry and stop the drawing

@manjitapandey
Copy link
Contributor

Yeah may be that work but I am unexpectedly redirected to odk even when I don't click on already existing node. We definitely have to switch to more intuitive drawing functionality help in UX drastically.

@spwoodcock
Copy link
Member Author

Can the conflicting click events be looked into?

In the other map click events can we check if drawing is enabled, if so then prevent the default behaviour and return.

Maybe that will fix it

@NSUWAL123
Copy link
Contributor

@spwoodcock I'll also look into this issue.

@NSUWAL123 NSUWAL123 self-assigned this Jan 23, 2025
@spwoodcock
Copy link
Member Author

@spwoodcock I'll also look into this issue.

Thank you!!

@manjitapandey
Copy link
Contributor

The entity is not created for new geometries. When should the entities be created?? Is it when the user saves the new polygon geometry to get redirected to odk for form submission or is it possible to create entity once the submission is sent and also link the recent submission with just created entity??
@spwoodcock , @Sujanadh
cc: @NSUWAL123

@manjitapandey manjitapandey removed priority:low Backlog of tasks that will be addressed in time testing:ready Ready for testing labels Jan 28, 2025
@spwoodcock
Copy link
Member Author

The entity is not created for new geometries. When should the entities be created?? Is it when the user saves the new polygon geometry to get redirected to odk for form submission or is it possible to create entity once the submission is sent and also link the recent submission with just created entity??
@spwoodcock , @Sujanadh
cc: @NSUWAL123

Entities in ODK should be created on form submission 👍 it needs to be looked into

@spwoodcock
Copy link
Member Author

@Sujanadh suggested removing the entity creation logic from the form, instead creating the entity in FMTM directly.

See discussion here hotosm/osm-fieldwork#338

This significantly simplfies our work, as XLSForms can be a bit finicky sometimes.

We also don't need a separate field to record new geoms this way, simply relying on selecting (or preselecting) an existing entity. We can then skip the geometry selection in ODK Collect entirely if its preselected (via intent URL)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code effort:medium Likely a day or two enhancement New feature or request frontend Related to frontend code
Projects
Development

No branches or pull requests

3 participants