Hi, I'm using a modified version of the Local Government Solution for Addressing. I would like to utilize the nearest street Attribute Rule; however, we have times when we need to change the street name to another street - primarily on corners. It works well to pull a street name and fill in the attributes; however, when we change it if needed, or if it is selecting the wrong street, we need to be able to change it and it stick. I've removed the update portion of the AR and it still puts the name back to what it chose originally. Any help on this would be greatly appreciated.
Thanks!
var streetLayer = FeatureSetByName($datastore, "StreetCenterline");
var searchDistance = 150;
var streetIntersect = Intersects(streetLayer, Buffer($feature, searchDistance, "feet"));
var cnt = Count(streetIntersect);
var minDistance = Infinity;
var stname = null;
if (!(isempty($feature.FullStreetName))) {
stname = $feature.FullStreetName;
}
else if ((cnt > 0) && (isempty($feature.FullStreetName))) {
for (var street in streetIntersect) {
var dist = Distance(street, $feature, "feet");
if (dist < minDistance) {
stname = street.FullStreetName;
minDistance = dist
}
}
} else {
// pass no features found within search distance, name remains null
}
return stname;