<?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: Compare Intersecting Polygon and Polyline in Arcade in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1577265#M1669</link>
    <description>&lt;P&gt;Update: I used the "Feature on Feature" Ready to Use rule with the DE-9IM relationship&amp;nbsp;1***0F*** and it works as needed! Thank you, Mike! Your suggestion to use Relate helped with the breakthrough.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 18:10:31 GMT</pubDate>
    <dc:creator>Clewells</dc:creator>
    <dc:date>2025-01-20T18:10:31Z</dc:date>
    <item>
      <title>Compare Intersecting Polygon and Polyline in Arcade</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1572457#M1657</link>
      <description>&lt;P&gt;I have a polyline feature class that corresponds to the centerline of a rectangular polygon feature class. I am trying to make an Attribute Rules set for validation that will compare specific attributes for the two corresponding features (Picture 1). In the example, I'm comparing the values of the length fields for the polyline and polygon that overlap. If the values for the two fields don't match, then I want an error/false.&lt;BR /&gt;&lt;BR /&gt;The issue is that there are sometimes 2 sets of features that intersect and create false positives (Picture 2 &amp;amp; 3). To avoid this, I want to only evaluating the intersecting polygon/polyline relationship with the largest overlap.&amp;nbsp; However, I am having some trouble with the sample code (See below).&amp;nbsp;I've also considered buffering the polyline and comparing overlaps, or to find the centroids and only compare the closest feature.&lt;BR /&gt;&lt;BR /&gt;I'm new to Arcade and still trying to figure things out. So any advice or examples of how I can modify the code would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Clewells_1-1735922488525.png" style="width: 189px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122673iDB8DC50CC9B16175/image-dimensions/189x271?v=v2" width="189" height="271" role="button" title="Clewells_1-1735922488525.png" alt="Clewells_1-1735922488525.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clewells_0-1735922450973.png" style="width: 301px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122670iF09C9D18BE955336/image-dimensions/301x219?v=v2" width="301" height="219" role="button" title="Clewells_0-1735922450973.png" alt="Clewells_0-1735922450973.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clewells_2-1735922621753.png" style="width: 272px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122674i624D769866C606B0/image-dimensions/272x207?v=v2" width="272" height="207" role="button" title="Clewells_2-1735922621753.png" alt="Clewells_2-1735922621753.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// variables for overlap comparison&lt;BR /&gt;var biggest_overlap = '';&lt;BR /&gt;var overlap_amount = 0;&lt;/P&gt;&lt;P&gt;// intersection&lt;BR /&gt;var linearrunway = (FeatureSetByName($datastore, "linear_runway"))&lt;BR /&gt;var intersect = Intersects(linearrunway,$feature)&lt;/P&gt;&lt;P&gt;// check if any features in the intersection&lt;BR /&gt;if (Count(intersect) &amp;gt; 0) {&lt;BR /&gt;// iterate over zones, calculate intersection amount and compare&lt;BR /&gt;for (var g in intersect) {&lt;BR /&gt;var xs = Intersection($feature, g)&lt;/P&gt;&lt;P&gt;// get area of overlap; subsitute length if linear features&lt;BR /&gt;var xs_overlap = LengthGeodetic(xs)&lt;/P&gt;&lt;P&gt;if (xs_overlap &amp;gt; overlap_amount) {&lt;BR /&gt;overlap_amount = xs_overlap&lt;BR /&gt;biggest_overlap = (Round(g.length, 2))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;if (biggest_overlap != (Round($feature.length,2))){&lt;BR /&gt;return false;&lt;BR /&gt;}else{&lt;BR /&gt;return true;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 22:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1572457#M1657</guid>
      <dc:creator>Clewells</dc:creator>
      <dc:date>2025-01-03T22:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Intersecting Polygon and Polyline in Arcade</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1572760#M1658</link>
      <description>&lt;P&gt;You could look at using Contains(&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#contains" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/geometry_functions/#contains&lt;/A&gt;) or Relate(&lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#relate" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/geometry_functions/#relate&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 12:52:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1572760#M1658</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2025-01-06T12:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Intersecting Polygon and Polyline in Arcade</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1577265#M1669</link>
      <description>&lt;P&gt;Update: I used the "Feature on Feature" Ready to Use rule with the DE-9IM relationship&amp;nbsp;1***0F*** and it works as needed! Thank you, Mike! Your suggestion to use Relate helped with the breakthrough.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 18:10:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-intersecting-polygon-and-polyline-in/m-p/1577265#M1669</guid>
      <dc:creator>Clewells</dc:creator>
      <dc:date>2025-01-20T18:10:31Z</dc:date>
    </item>
  </channel>
</rss>

