Hi All,
I have an arcade script that I often use to return the closest value to a given point. In this case, an address number. When I try it in this particular instance, I receive "Test execution error: Execution error - Cannot access value using a key of this type. Verify test data."
This is my script. The funny thing is that I copied it from another calculation (in field maps) just to return an ID from a water main. I am not sure why this one isn't working.
var address = FeatureSetByName($map, "Addresses")
var searchDistance = 1
var closestPlace = Intersects(address, Buffer($feature, searchDistance, 'miles'))
var minDistance = Infinity
for (var place in closestPlace){
var placeDistance = Distance(place, $feature, 'mile');
if (placeDistance < minDistance){
minDistance = placeDistance;
closestPlace = place;
}
};
return closestPlace.bldg_num
thank you!