I used the similar code in arcade to find the nearest address point(Using Arcade to Find the Nearest Address Point )
My question is does the distance calculated by buffer and route service are same or almost same
or is it possible to find nearest distance from $feature to address
var searchDist = 200;
var addresses = Intersects(FeatureSetById($map, "Primary_Address_3482"), Buffer( $feature, searchDist, "feet"));
var cnt = Count(addresses)
Console("Total Number of addresses within buffer: " + cnt);
var nearestaddress;
var min_dist = 250;
for (var f in addresses){
var addressDist = Round(Distance(f, $feature, "feet"),2);
if (addressDist < min_dist) {
nearestaddress = f.FULL_ADDR;
min_dist = addressDist;
}
Console(f.FULL_ADDR + ": " + " " + addressDist);
}
return nearestaddress;
Thanks
Solved! Go to Solution.
Hi MR Reddy ,
There are a couple of things to keep in mind:
Hi MR Reddy ,
There are a couple of things to keep in mind: