limit the distance between user location and the captured data

455
6
03-03-2022 05:06 AM
HalaAbdelmaksoud
Occasional Contributor

Hi all,

can I limit the distance between the user's location and the captured feature, for example: the user must be within a distance of 5meter from the captured feature? 

Tags (1)
0 Kudos
6 Replies
ColinLawrence
Esri Regular Contributor

Hi @HalaAbdelmaksoud ,

Do the field workers need to be on the feature they are collecting (ie can they use the built in gps as the location for the features)? You can set a required accuracy for the GPS that will ensure data quality in this scenario. 

If that doesnt help, the closest functionality I can think of is that we can restrict the use of the "Collect here" button, which can be used to place points at a certain location by long pressing on the map. This functionality can be removed on a per map basis from the particular Web Map in Field Maps Web. 

ColinLawrence_0-1646339807329.png

Regards,
Colin

Regards,
Colin
0 Kudos
DougBrowning
MVP Esteemed Contributor

No but you can use a calc in Arcade to yell at them they are too far in red.  Best I could find.

Survey123 can do it though.

0 Kudos
HalaAbdelmaksoud
Occasional Contributor

@DougBrowning 

Could you please explain more about how to use arcade?

I think that in the case we use arcade, we have to add another layer for the field worker location.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Just convert the formula above to arcade like this

var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
var lat = (Geometry($feature).y / originShift) * 180.0;

lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);

return Round(Acos(Sin(lat * PI / 180)*Sin($feature.DesignLat * PI / 180) + Cos(lat * PI / 180)*Cos($feature.DesignLat * PI / 180)*Cos(($feature.DesignLong * PI / 180)-(lon * PI / 180))) * 6371000,2)

It basically calcs the lat, long of the point then compares to the static lat/long they were supposed to go to.

DougBrowning_0-1646749766022.png

 

You can then add a if if you want.  Like if distance>5 then return Warning you are too far type message.

Hope that helps.

0 Kudos
HalaAbdelmaksoud
Occasional Contributor

Sorry, but could you please explain where did you write this expression ? In Field maps expressions or in field calculations of the field in the web map? What do you mean by "DesignLat" & "DesignLong"?

Just a note: the field worker's location and the surveying feature location, both of them, are dynamic and changed from a place to another.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Design Lat long is where they are supposed to be.  Prob would be surveying location in you case.  You are just comparing one lat/long pair to the other.

This is all Arcade in the webmap. 

Sounds like you need to read up on using Arcade in web maps that you use in Field Maps.   You should also look into Survery123 as this sounds a bit compilated for FieldMaps.

0 Kudos