<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS Pro Attribute Rules Equivalent to NEAREST_FEATURE Function in Attribute Assistant in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031464#M37985</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/418598"&gt;@GISUSER6&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do something like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var streetLayer = FeatureSetByName($datastore, "streets", ["NAME"]);
var searchDistance = 100;
var streetIntersect = Intersect(streetLayer, BufferGeodetic($feature, searchDistance, "feet"));
var cnt = Count(streetIntersect);

var minDistance = Infinity;
var name = Null
if (cnt &amp;gt; 0) {
    for (street in streetIntersect) {
        var dist = DistanceGeodetic(street, $feature, "feet");
        if (dist &amp;lt; minDistance) {
            name = street.NAME;
            minDistance = dist
        }
    }
} else {
    // pass no features found within search distance, name remains null
}

return name;&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 01 Mar 2021 13:29:40 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2021-03-01T13:29:40Z</dc:date>
    <item>
      <title>ArcGIS Pro Attribute Rules Equivalent to NEAREST_FEATURE Function in Attribute Assistant</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031093#M37940</link>
      <description>&lt;P&gt;ArcGIS Pro 2.7&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to set up an attribute rule that will pull from the NAME field of a streets center line layer and populate it into a STREET field in the feature class I am adding the rule to. I know the same function does not exist in Attribute Rules as it does for NEAREST_FEATURE in Attribute Assistant, but I am trying to come up with an Arcade expression to do the same thing. The search distance I want to use is 100 ft. Attached is the snip of the code I started with but I keep getting an error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some guidance would be much appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 19:09:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031093#M37940</guid>
      <dc:creator>GISUSER6</dc:creator>
      <dc:date>2021-02-26T19:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Attribute Rules Equivalent to NEAREST_FEATURE Function in Attribute Assistant</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031464#M37985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/418598"&gt;@GISUSER6&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do something like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var streetLayer = FeatureSetByName($datastore, "streets", ["NAME"]);
var searchDistance = 100;
var streetIntersect = Intersect(streetLayer, BufferGeodetic($feature, searchDistance, "feet"));
var cnt = Count(streetIntersect);

var minDistance = Infinity;
var name = Null
if (cnt &amp;gt; 0) {
    for (street in streetIntersect) {
        var dist = DistanceGeodetic(street, $feature, "feet");
        if (dist &amp;lt; minDistance) {
            name = street.NAME;
            minDistance = dist
        }
    }
} else {
    // pass no features found within search distance, name remains null
}

return name;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Mar 2021 13:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031464#M37985</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-03-01T13:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Attribute Rules Equivalent to NEAREST_FEATURE Function in Attribute Assistant</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031674#M38010</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1108"&gt;@XanderBakker&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This looks great. Thanks for your help. I see that this function is limited to&amp;nbsp;Web Mercator (wkid 3857) or a WGS 84 (wkid 4326) spatial reference. (&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/arcade/function-reference/geometry_functions/&lt;/A&gt;&amp;nbsp;)&amp;nbsp;I think this is the reason I am coming up with an error message when I use the code you provided. Do you know if there is a work around for this? I am working with a Wisconsin county reference system.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I worked with ESRI customer service on this issue but we have been unsuccessful so far. I even tried projecting the streets layer that the BufferGeodetic is being use to WGS 1984 but this still produces the Error on line 3. Projection is invalid. There's got to be something that I am doing wrong still or there has to be a work-around.. otherwise Attribute Rules is super restricting when it comes to this! A text file as been attached with my latest Arcade code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 13:52:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1031674#M38010</guid>
      <dc:creator>GISUSER6</dc:creator>
      <dc:date>2021-03-09T13:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Attribute Rules Equivalent to NEAREST_FEATURE Function in Attribute Assistant</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1035914#M38459</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/418598"&gt;@GISUSER6&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did a test with a local coordinate system and it will work with some minor adjustments:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XanderBakker_0-1615556627727.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8310iB3779A6687387216/image-size/medium?v=v2&amp;amp;px=400" role="button" title="XanderBakker_0-1615556627727.png" alt="XanderBakker_0-1615556627727.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use Buffer instead of BufferGeodetic&lt;/LI&gt;&lt;LI&gt;Use Distance instead of DistanceGeodetic&lt;/LI&gt;&lt;LI&gt;Place "var" before street in the for loop.&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;var streetLayer = FeatureSetByName($datastore, "streets_WGS_Project", ["NAME"]);
var searchDistance = 100;
var streetIntersect = Intersects(streetLayer, Buffer($feature, searchDistance, "feet"));
var cnt = Count(streetIntersect);

var minDistance = Infinity;
var name = Null
if (cnt &amp;gt; 0) {
    for (var street in streetIntersect) {
        var dist = Distance(street, $feature, "feet");
        if (dist &amp;lt; minDistance) {
            name = street.NAME;
            minDistance = dist
        }
    }
} else {
    // pass no features found within search distance, name remains null
}

return name;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 13:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1035914#M38459</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-03-12T13:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro Attribute Rules Equivalent to NEAREST_FEATURE Function in Attribute Assistant</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1038222#M38743</link>
      <description>&lt;P&gt;This worked perfectly! Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 19:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcgis-pro-attribute-rules-equivalent-to-nearest/m-p/1038222#M38743</guid>
      <dc:creator>GISUSER6</dc:creator>
      <dc:date>2021-03-18T19:00:24Z</dc:date>
    </item>
  </channel>
</rss>

