<?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: Attribute Rule: Auto Populate Fields to Nearest Feature in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113123#M47401</link>
    <description>&lt;P&gt;Do you want each tributary of a watercourse tested separately or if any tributary is within 100 km of a road?&lt;/P&gt;&lt;P&gt;That will make a big difference on the outcome.&amp;nbsp; For example, how many different ones are depicted in your image?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Nov 2021 09:10:12 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-11-02T09:10:12Z</dc:date>
    <item>
      <title>Attribute Rule: Auto Populate Fields to Nearest Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113105#M47399</link>
      <description>&lt;P&gt;I am working with a large set of Ontario watercourses and wish to automatically populate a field with the nearest road network. In the picture below, the watercourses are represented by the blue lines and the road network is represented by the purple lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YongXin_0-1635834125485.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26589iBB347E25BD816EA0/image-size/large?v=v2&amp;amp;px=999" role="button" title="YongXin_0-1635834125485.png" alt="YongXin_0-1635834125485.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am trying to have a field titled&amp;nbsp;&lt;EM&gt;NearestRoad&lt;/EM&gt; auto-populate with the nearest road network that is 100km from it. Is there a way to go about this? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 06:24:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113105#M47399</guid>
      <dc:creator>YongXin</dc:creator>
      <dc:date>2021-11-02T06:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule: Auto Populate Fields to Nearest Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113107#M47400</link>
      <description>&lt;LI-CODE lang="javascript"&gt;function closest_feature(test_feature, compare_feature_set) {
  var min_distance = 9999999
  var closest_feature = null
  for(var f in compare_feature_set) {
    var d = Distance(test_feature, f)
    if(d &amp;lt; min_distance) {
      min_distance = d
      closest_feature = f
    }
  }
  return closest_feature
}

var roads = FeatureSetByName($datastore, "RoadFeatureclass", ["RoadID"], true)
var waterway_buffer = Buffer($feature, 100, "kilometers")
var close_roads = Intersects(roads, waterway_buffer)
var closest_road = closest_feature($feature, close_roads)
if(closest_road != null) {
  return closest_road.RoadID
}
return null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 07:30:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113107#M47400</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-11-02T07:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rule: Auto Populate Fields to Nearest Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113123#M47401</link>
      <description>&lt;P&gt;Do you want each tributary of a watercourse tested separately or if any tributary is within 100 km of a road?&lt;/P&gt;&lt;P&gt;That will make a big difference on the outcome.&amp;nbsp; For example, how many different ones are depicted in your image?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 09:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-auto-populate-fields-to-nearest/m-p/1113123#M47401</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-11-02T09:10:12Z</dc:date>
    </item>
  </channel>
</rss>

