Calculating a geotrace from 2 geopoint repeat records

1522
4
07-16-2021 05:02 AM
Adrian_S
New Contributor II

I need to display on a map on a form a line connecting a series of geopoints.  Can anyone suggest please a better way to do it than outlined below?

The geopoints are entered by people surveying lengths of hedge to mark changes such as different characteristics or direction.

I've almost got a solution, in Survey123 (XLSForm is attached below). However, in the field app the map displays without the blue geotrace line showing: calculated geotrace - before refresh.png

It's only after the surveyor goes back one repeat and manually taps the map refresh button (circled in red above) that the line appears:calculated geotrace - after refresh.png

Is there a way to auto-refresh, or another method altogether?

4 Replies
BarbaraWebster1
Esri Regular Contributor

Hi Adrian,

You could put one geopoint in a repeat and then calculate the geotrace outside the repeat with the sum() function. See the attached XLS.

This XLS is an excerpt from the Line and Polygons sample survey, which demos a few other methods for working with lines and polygons that might be useful. It's available in Connect when you click on New Survey>Samples and search for Lines and Polygons. 

-Barbara

Adrian_S
New Contributor II

Thanks Barbara.

Not quite what I was asking. Sorry if I've confused everyone!

Your geotrace includes all the repeated geopoints, whereas I need the trickier case of a geotrace of any 2 geopoints selected from many.

As per my original solution, I'd solved that, except that the geotrace requires manual refresh, for every repeat instance.

Any thoughts on eliminating the manual refresh please?

Adrian.

0 Kudos
DerrickWestoby
Occasional Contributor III

What about using once() on the geotrace calc, along with adding a condition to the relevant column that the geotrace isn't calculated until you have 2 repeat entries, using count()? 

I don't know if this will work or not, but I did use the relevant/count approach when geoshape & geoshape were first released to keep from having to hit the refresh button on the geoshape once 3 or more repeats were added.  I'm assuming that using once(sum(${repeat_location}) for the geotrace calc would work, but haven't tried it. 

edit: After re-reading, hopefully I'm not misunderstanding the question too.  I'm assuming that you're just wanting to calculate a 2-vertex line out of any random two geopoints in a repeat, and that it only needs to happen once, and you don't care which 2 points.  Now that I noticed you're creating a tool for surveyors, I'm thinking I misunderstood the workflow.  Is this just a tool for them to input coordinates and calculate a projected bearing and distance as-needed or something?   I guess a different approach if that is the case could be to create nested repeats, where the the geotrace is contained within a repeat and max-2 geopoints are contained in a nested repeat.   I assume this would allow the surveyors just to add + a new repeat (the geotrace) each time they need to do a new calc, instead of changing the existing points and refreshing the existing geotrace.   

Apologies if I'm way off the mark on one or both of these comments...

BarbaraWebster1
Esri Regular Contributor

Does the geotrace question need to be in the repeat for your workflow? If you moved it outside the repeat and used the same calculation method from your original XLS form (current geopoint concatenated with the next geopoint in the repeat), you would be able to see the geotrace based on two geopoints and wouldn't need to manually recalculate every time a geopoint is added or changed (see attached XLS form). 

As far as I know there isn't currently a way to change the default calculation behavior for the geotrace question inside the repeat.  

-Barbara

0 Kudos