Location at the touch of a button

Here's a constraint that gets the 4th element (1st point's accuracy) of a 0-indexed space delimited array, takes the string before the ; then checks to ensure it's not 0, as manually selected points will have elevation and accuracy of 0.

substring-before(selected-at(${polygon}, 3), ';') != 0

eg ODK format polygons so the first would pass and the second would fail:
12.371400 -1.519700 305 17.4; 13.371400 -2.519700 305 17.4; 14.371400 -3.519700 305 17.4

12.371400 -1.519700 0.0 0.0; 13.371400 -2.519700 0.0 0.0; 14.371400 -3.519700 0.0 0.0

If you wanted to be very thorough in case of mixing tapping and automatic points, you could add the 2nd & 3rd points (min to have a polygon), but beyond 3 points you would have to utilise a repeat.

substring-before(selected-at(${polygon}, 3), ';') != 0 and substring-before(selected-at(${polygon}, 7), ';') != 0 and substring-before(selected-at(${polygon}, 11), ';') != 0

Edit: Catching up on posts I see that @LN has previously posted this approach and you have seen it.

1 Like