<?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 Rules Intersect Features in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1483095#M1484</link>
    <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2024 11:12:43 GMT</pubDate>
    <dc:creator>ShareUser</dc:creator>
    <dc:date>2024-06-03T11:12:43Z</dc:date>
    <item>
      <title>Attribute Rules Intersect Features</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1412736#M1385</link>
      <description>&lt;P&gt;Hi All&lt;BR /&gt;I have code (Arcade) that I used inside Attributes Rules,&lt;BR /&gt;I have a neighborhood layer from the digitization of a paper map, and a plots layer from a field survey, meaning it is more accurate than the neighborhood layer.&lt;BR /&gt;When creating (Create Feature) a new plot, sometimes the plot intersects with more than one neighborhood, not only touching, but intersecting, and the intersection can be five meters, which is the difference between the paper map and the boundaries of new plots from the field survey. I would like to modify the following code:&lt;/P&gt;&lt;PRE&gt;var VILLAGE_E = FeatureSetByName ($datastore, "Blocks_Sector", ["VILLAGE_E"])
var Intersecting_feature = Intersects(VILLAGE_E, $feature)
var Out_str = null
for (var x in Intersecting_feature){
     var VILLAGE_E_VILLAGE_E = DomainName(x, 'VILLAGE_E')
     out_str = VILLAGE_E_VILLAGE_E}
return out_str&lt;/PRE&gt;&lt;P&gt;Can you modify the code for this goal?&lt;BR /&gt;if there is an intersection and not just a touch, the Field Value is transferred from the neighborhood with the most intersection to the plot that was created.&lt;BR /&gt;Pictures for clarification:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;Create a plot of land within the neighborhood and take the correct neighborhood name&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HusamJubeh_0-1711053931129.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="HusamJubeh_0-1711053931129.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98719i4A87D366BD7AC20A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HusamJubeh_0-1711053931129.png" alt="HusamJubeh_0-1711053931129.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;create a plot of land that touches more than one neighborhood, the name of the neighborhood that contains the plot has been taken, and this is correct&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HusamJubeh_1-1711053930865.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="HusamJubeh_1-1711053930865.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98717i13516E1CEEC64024/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HusamJubeh_1-1711053930865.png" alt="HusamJubeh_1-1711053930865.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;The third case is where I would like to modify the code for such cases:&lt;BR /&gt;A plot was created that intersects a few meters with a neighboring neighborhood, and as a result the wrong name was taken&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HusamJubeh_2-1711053931034.png" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="HusamJubeh_2-1711053931034.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/98718i52D1901E8389F9DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HusamJubeh_2-1711053931034.png" alt="HusamJubeh_2-1711053931034.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;*&amp;nbsp;The name should be Abu Qash, not Surda&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What is the correct code in this case?&lt;/P&gt;&lt;P&gt;Please help, many thanks&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2024 12:18:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1412736#M1385</guid>
      <dc:creator>ShareUser</dc:creator>
      <dc:date>2024-04-20T12:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules Intersect Features</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1413643#M1393</link>
      <description>&lt;P&gt;I think you will need to use a function like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function closest_item(feat_set) {

    var closest_feature = null;
    var closest_distance = INFINITY;
    var feat_geo = Geometry($feature);
    
    for (var feat in feat_set) {
        var current_distance = Distance(feat_geo, Geometry(feat), 'meters');
        if (current_distance &amp;lt; closest_distance) {
            closest_feature = feat;
            closest_distance = current_distance;
        }
    }
    return closest_feature;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Apr 2024 18:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1413643#M1393</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2024-04-22T18:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Rules Intersect Features</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1483095#M1484</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2024 11:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/attribute-rules-intersect-features/m-p/1483095#M1484</guid>
      <dc:creator>ShareUser</dc:creator>
      <dc:date>2024-06-03T11:12:43Z</dc:date>
    </item>
  </channel>
</rss>

