Measuring distance between geopoints in two different repeats

08-17-2020 11:54 AM
New Contributor

In my survey I have used the Haversine formula to calculate the distance between two points (the survey point & points in a repeat) - using this blog post

However ideally i want to measure points in one repeat to a point in a different repeat, when i do this it appears to measure to the last geopoint in that repeat (is this correct?)

My example is:

Repeat 1: points around the edge of a building (lets say 4 if its a rectangle, and using the geoshape sum${repeatname} to create a polygon).

Repeat 2: points locating position of electricity poles (lets say there's two in the repeat, at opposite sides of the building).


I want to calculate the distance from each pole to the nearest point of the building. Ideally i'd measure from the repeating points (poles) to one geoshape (building) but i don't think this is possible, so trying a workaround to calculated from point to point.


Any help would be really appreciated!

0 Kudos
1 Reply
Esri Regular Contributor

Hello Phil Rees‌, 

What you observe is correct, the way Repeat processing in handled currently is based on the last or current repeat. 

One option may be to use join() function which should create a concatenated list of all XY coordinates. You can then use the substr() function to extract specific pieces of the list to calculate the distance. 

Please use this link for reference regarding Formulas in ArcGIS Survey123: Formulas—ArcGIS Survey123 | Documentation 

The issue then becomes configuring the calculation to accommodate dynamic point inputs. 

An alternative workflow would be to use a custom JavaScript function to process the data in the repeat. Please use this link for reference regarding custom JavaScript functions: 

Thank you, 


Thank you,