Multiple Geopoints to calculate curve distance

290
2
08-04-2021 02:10 PM
Colin_Schut
New Contributor III

I've created a form that uses the following formula to calculate the straight line distance between geopoints. This worked great, but new requirements has meant that calculating distance around a curve is required and the straightline distance will be outside the acceptable error in some cases.

if(number(${upchain_curve_location_lat})!=0,int(acos(sin(${upchain_curve_location_lat})*sin(${access_lat}) + cos(${upchain_curve_location_lat})*cos(${access_lat})*cos(${access_long}-${upchain_curve_location_long}) ) * 6371000),0)

The use case is a maximum of 4 geopoints within a repeat in addition to the main geopoint, one per type of feature since we're only collecting the nearest of each type. For safety reasons, I can't insure that they are collected in order (as they're collected along a road), and anywhere from 1 to all 4 may be present.

My idea is to calculate the straightline distances for each geopoint to allow them to be ordered by distance (either in separate fields in the main table or in a hidden join), calculate the distances between each succeeding points and then sum them up. So point 4 would be the sum of "Original to Point 1", "Point 1 to Point 2", etc. It's not exact but will likely be close enough for us

I've been thinking of ways to use the max and index functions but I'm not sure it's possible to parse out the values in this way.

The hope is to use these distances to trigger integromat workflows. Any suggestions are appreciated. 

Tags (1)
0 Kudos
2 Replies
DeonLengton
Esri Contributor

Hi Colin

Did you manage with this requirement?

Perhaps you could share your survey and an example so I can get a better understanding of the workflow

0 Kudos
Colin_Schut
New Contributor III

I did not, we chose to move forward by adding a question to indicate it was on a curve to highlight them to check in the office. Not ideal because the "incorrect" values are still recorded in the data.

I can send the xls file if that's alright, I can't share it publicly. 

0 Kudos