Select to view content in your preferred language

DistanceGeodetic not working in QuickCapture

107
1
02-07-2025 04:10 PM
Labels (1)
Moff
by
New Contributor

DistanceGeodetic isn't working in QuickCapture. Will trigger in the designer, but blank on actual capture. The Distance function does work, but is not what I need. 

Unsure if it's related to the same issue listed here: https://community.esri.com/t5/arcgis-field-maps-questions/distancegeodetic-not-working-in-fieldmaps/...Figured I would throw it out there as an issue. 

Also - the help resource for the function within the Arcade editor has a different capitalization format than the current function. 

0 Kudos
1 Reply
JohnathanHasthorpe
Esri Regular Contributor

The following worked for me:

var facilities = FeatureSetByName($map, "Medical");
var point_fs = Intersects(facilities, Buffer($feature, 2000, "meters"));
var min_dist = 99999;
var nearest_medicalName = null;
var geo = Geometry($feature);
 
for (var point in point_fs) {
  var point_geo = Geometry(point);
  var dist = DistanceGeodetic(geo, point_geo, "meters");
  if (dist < min_dist) {
    min_dist = dist;
    nearest_medicalName = point.name;
  }
}
return nearest_medicalName;
 
Note that following:
- DistanceGeodetic function only works between 2 points, not lines,
- The designer will run the expression on the first feature in the feature layer you are targetting.
 
Please share your expression if you need assistance in troubleshooting this.
 
Cheers
John
0 Kudos