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

Addition of distance constraints between user's geolocation and feature selected for mapping #1985

Open
manjitapandey opened this issue Dec 12, 2024 · 8 comments
Assignees
Labels
effort:low Likely a few hours enhancement New feature or request frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time testing:ready Ready for testing

Comments

@manjitapandey
Copy link
Contributor

manjitapandey commented Dec 12, 2024

Is your feature request related to a problem? Please describe.
Currently, user can select the feature far away from their current location. This causes enumerators to share incorrect data sometimes.

Describe the solution you'd like
Restrict the user to select the feature that are far away from their current location. For that we need to necessarily ask for geolocation on mapper's page and if users click on feature far away and click on map on odk. The error message saying the feature you are trying to map is xx km away from your current location.

@spwoodcock
Copy link
Member

See the linked dup issue for some additional info

@manjitapandey manjitapandey added frontend Related to frontend code priority:high Should be addressed as a priority labels Dec 16, 2024
@manjitapandey
Copy link
Contributor Author

As you mentioned in duplicate issue,

Instead open a confirmation dialog / modal: 'The created geometry is far away from your current location. Are you sure you wish to proceed?'

Are you suggesting just the warning message or complete blocking to submission?

Showing the warning is good but I think we should make the feature a bit dynamic my adding the feature of whether project creator wants to add restriction or not.
During project creation, we can ask project creator if they want to restrict the selection of feature away from their current location. If project creator ticks on the restriction, they can add their own proximity distance as well.
We can cover more use cases this way for both open projects and strictly monitored projects.

What are your opinion? @spwoodcock , @ramyaragupathy

@spwoodcock
Copy link
Member

I don't think this feature should touch the backend in any way & shouldn't need configuration.

Its just a helpful warning / indicator to the user in the field.

Adding a dialog to say 'are you sure you wish to proceed' isn't blocking - its just a warning.

The reason we need this and not just a toast warning notification is that clicking to create a new feature currently opens ODK Collect immediately, so the user will not see any warning

@spwoodcock spwoodcock added priority:low Backlog of tasks that will be addressed in time effort:low Likely a few hours and removed priority:high Should be addressed as a priority labels Dec 16, 2024
@manjitapandey
Copy link
Contributor Author

Talked to tokha team, If we don't wanna implement it in FMTM, we can only build this feature for tokha using 100 meter threshold for now.

@spwoodcock
Copy link
Member

spwoodcock commented Jan 8, 2025

Seems like they are really keen to have this & If it's something that they need, perhaps others will need it in future too.
No point diverging the code - we can make this optional config for a project instead.

I think we should solve this like:

  • Add a new db field projects.geo_restrict_distance_meters as an int2, default 50.
  • Add a new db field projects.geo_restrict_force_error as a boolean, default false.
  • Return these fields in the project response.
  • If the field geo_restrict_force_error is false, have a warning on the distance constraint.
  • If the field geo_restrict_force_error is true, have a warning on the distance constraint.

I can add these fields on the db / backend today to faciliate.

What do you think @manjitapandey @NSUWAL123 ?

@spwoodcock
Copy link
Member

I will do the db edits alongside requirements for #1979

@NSUWAL123
Copy link
Contributor

Yeah, this sounds good and will surely be a great feature too. We are integrating this into project creation, right? If then in which step shall we incorporate this?
Assign me once you have completed this on the backend since I have code ready for the restriction part.

@spwoodcock
Copy link
Member

spwoodcock commented Jan 9, 2025

Done the backend part 👍

All projects default to have geo_restrict_distance_meters=50 and geo_restrict_force_error=false.

Eventually, a config option during project creation would be nice. But not essential for now. We can just tweak the project in the DB if needed.

@NSUWAL123 NSUWAL123 added the testing:ready Ready for testing label Jan 13, 2025
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:low Backlog of tasks that will be addressed in time testing:ready Ready for testing
Projects
None yet
Development

No branches or pull requests

4 participants