In support of Blocking invalid (self-intersecting) polygons in Collect, we propose adding the following function to the spec:
The boolean incremental attribute (see W3C XForms) is recognized on the geotrace and geoshape form control (body) elements. When a geotrace or geoshape question has incremental=true, any change to the value such as moving a vertex, adding a vertex, removing a vertex results in validating the new value and showing a constraint message if the constraint is violated. Clients may additionally choose to block the addition of new points when a constraint is violated to draw user attention to the problem. Clients may choose to recalculate and revalidate the whole form or not depending on performance considerations and how they display geo questions.
If no value or an invalid value is given for the attribute, it is ignored and revalidation and recalculation happen according to the client’s defaults.
This will primarily combine with the intersects function to provide ongoing feedback about self-intersections but could also be used to enforce things like a maximum expected area or perimeter.