Blocking invalid (self-intersecting) polygons in Collect

Data collectors sometimes create invalid polygons due to GPS drift or user error, crossing over an already mapped area. Collect doesn’t provide real-time validation or guidance for fixing these geometry issues, so errors are often discovered after submission, requiring time-consuming rework.

Based on feedback from users and the scenarios you’ve shared in the forum, we’ve identified 4 common situations that lead to invalid polygons:

4 common scenarios
  • Slight cross over at the corner

    • May happen if the data collector pauses and an extra point is captured

    • Could also occur when going around obstacles (e.g., a fence)

    • In manual mode, may result from an accidental double long press

  • Cross over due to GPS spike

    • Can occur when GPS signal drifts, especially if the user walks slowly

    • :light_bulb: May be reduced by setting an accuracy threshold

  • Crossover in narrow or connecting areas

    • Can occur when mapping narrow sections or when segments connect

    • User can move to a better position or manually place a non-overlapping point

  • Cross over when polygon is closed

    • Happens when the shape overlaps as it’s completed

    • Can be detected at save time, once the shape is finished

    • Best fix is to move the first point (PMs need to be fine with 0 accuracy)

Proposal

We’re exploring adding an opt-in continuous constraint evaluation for Collect's geopoint/trace/shape questions and a function to detect line intersections. Constraints would be evaluated every time the user makes a change. If the constraint is violated, the user would be blocked from adding more points until they delete or move existing points such that the constraint is no longer violated.

Blocking the addition of new points makes it clear to the user that they have to take action. It also means that the functionality is only appropriate for failed constraints that can be fixed by deleting or moving points such as checking for self-intersections.

For example:

  • If self-intersections aren't allowed, creating a self-intersection causes a constraint violation and the user would be blocked from adding more points

  • If a constraint requires at most 4 points, adding a 5th causes a constraint violation and the user would be blocked from adding more points

User goals

For project managers

  • Ensure all submissions have valid geometry

  • Errors are fixed immediately for more accurate data

  • Flows remain simple and require minimal training

For data collectors

  • Guided capture experience with clear feedback

  • Easy-to-follow prompts for fixing invalid polygons

User flow

Example flow using placement mode

  1. The user begins adding points to create a polygon

  2. They accidentally create a crossover, which breaks the constraint

  3. A snackbar message appears, using the constraint message defined to explain why the shape is invalid

  4. The user can tap the action in the snackbar to open a short guide explaining how to fix the issue in placement mode

  5. The user modifies the map based on the guidance (e.g., long press to move or undo last point)

  6. The error is resolved, and the polygon can be saved successfully

XLSForm

Full example

Add a key/value pair of constraint-eval=on-change to the parameters column which is only accepted for geopoint/trace/shape. Any value other than on-change is rejected.

Next steps

We will be discussing this proposal in more detail with the @Insiders on Nov 5th! Free free to add reactions and thoughts here or bring them to the call.

3 Likes