<?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 arcade Intersecting Polygon problems due to minor boundary overlap in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335297#M54920</link>
    <description>&lt;P&gt;You can use a small negative buffer:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var ImpCatchments = Featuresetbyname($datastore, "attains_au_catchments_Impaired")
var IntImpCat = Intersects(Buffer($feature, -10, "meters"), ImpCatchments)
var cnt = count(IntImpCat)
IIF(cnt &amp;gt; 0, "Y", "N");&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 05 Oct 2023 10:05:39 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-10-05T10:05:39Z</dc:date>
    <item>
      <title>ArcGIS arcade Intersecting Polygon problems due to minor boundary overlap</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335256#M54914</link>
      <description>&lt;P&gt;I recently posted about getting help with code that returned a Y/N value based on if two polygon features intersected. The code worked great, but the two layers don't share perfectly aligned boundaries. One has a more "jagged" boundary that is visible when zoomed, causing it to flag as an intersection when it is not supposed to be. Any advice on a workaround? Would the "within" or "contains" function be more useful? Is there a way to buffer the boundary so that the slight mis-alignment doesn't produce an incorrect result?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Close Up boundaries.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/82358i495FD049ACF25CFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Close Up boundaries.png" alt="Close Up boundaries.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The larger polygons in orange are watersheds, and the smaller green polygons are impaired catchments. If there is even a single impaired catchment within a given watershed, I want to populate the field "is impaired" with "Y", or "N".&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Large watersheds and small catchments.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/82359i79B32C5748DCD05E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Large watersheds and small catchments.png" alt="Large watersheds and small catchments.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;&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;My current code:&lt;/P&gt;&lt;P&gt;var ImpCatchments = Intersects(Featuresetbyname($datastore, "attains_au_catchments_Impaired"), $feature)&lt;BR /&gt;var cnt = count(ImpCatchments)&lt;BR /&gt;IIF(cnt &amp;gt; 0, "Y", "N");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be very much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 03:28:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335256#M54914</guid>
      <dc:creator>BrennonPeterson</dc:creator>
      <dc:date>2023-10-05T03:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS arcade Intersecting Polygon problems due to minor boundary overlap</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335297#M54920</link>
      <description>&lt;P&gt;You can use a small negative buffer:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var ImpCatchments = Featuresetbyname($datastore, "attains_au_catchments_Impaired")
var IntImpCat = Intersects(Buffer($feature, -10, "meters"), ImpCatchments)
var cnt = count(IntImpCat)
IIF(cnt &amp;gt; 0, "Y", "N");&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 10:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335297#M54920</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-10-05T10:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS arcade Intersecting Polygon problems due to minor boundary overlap</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335465#M54929</link>
      <description>&lt;P&gt;This is what I was looking for! Though, I received an error, and it doesn't seem to be doing what is intended. The initial error I got was that "search geometry cannot be null". I assumed that maybe the buffer created null values, so I added and if-else statement to negate the error. Even with the buffer, I am still getting "Y" values for intersection where I shouldn't. I even expanded the buffer up to -40 meters with no success.&lt;/P&gt;&lt;P&gt;Code I am using:&lt;/P&gt;&lt;P&gt;var ImpCatchments = Featuresetbyname($datastore, "attains_au_catchments_Impaired")&lt;BR /&gt;var IntImpCat = Intersects(Buffer($feature, -20,"meters"),ImpCatchments)&lt;BR /&gt;If(Geometry(Buffer($feature, -20,"meters"))==null)&lt;BR /&gt;{&lt;BR /&gt;return "Geometry Null";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;var cnt = count(IntImpCat)&lt;BR /&gt;IIF(cnt &amp;gt; 0, "Y", "N");&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 16:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335465#M54929</guid>
      <dc:creator>BrennonPeterson</dc:creator>
      <dc:date>2023-10-05T16:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS arcade Intersecting Polygon problems due to minor boundary overlap</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335545#M54935</link>
      <description>&lt;P&gt;Null geometries are created when you try to buffer too much. You probably have small polygons in your fc. In these cases, the buffer of one side would end up on the outside of the polygon on the other side, resulting in a null geometry. This is difficult to explain, so here is a quick sketch:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1696532755735.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/82420i1867768902696644/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1696532755735.png" alt="JohannesLindner_0-1696532755735.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;On the left, a polygon (black) and a negative buffer (red) with appropriate buffer distance (blue).&lt;/P&gt;&lt;P&gt;On the right, the buffer distance is too big for the polygon, so the buffer's sides would end up outside of the polygon, creating a nonsensical geometry (not saying that the buffer algorithm actually works this way, just as a concept).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tl;dr: use an appropriately small buffer size or exclude polygons with small area from the calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To use your check, you have to put it before the actual error:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var ImpCatchments = Featuresetbyname($datastore, "attains_au_catchments_Impaired")

var NegBuffer = Buffer($feature, -20, "meters")
if(NegBuffer == null) { return "Polygon too small" }

var IntImpCat = Intersects(NegBuffer,ImpCatchments)
var cnt = count(IntImpCat)
return IIF(cnt &amp;gt; 0, "Y", "N")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 19:16:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335545#M54935</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-10-05T19:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS arcade Intersecting Polygon problems due to minor boundary overlap</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335560#M54936</link>
      <description>&lt;P&gt;Thank you for the explanation! Though, I get all null values when I run that code. Even for my largest polygons that shouldn't pose a problem...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 20:05:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335560#M54936</guid>
      <dc:creator>BrennonPeterson</dc:creator>
      <dc:date>2023-10-05T20:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS arcade Intersecting Polygon problems due to minor boundary overlap</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335705#M54946</link>
      <description>&lt;P&gt;Hmm... Difficult to&amp;nbsp; say what's wrong without the actual data. Would it be possible to send me an extract of your data? Either here or in a pm.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 09:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcgis-arcade-intersecting-polygon-problems-due-to/m-p/1335705#M54946</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-10-06T09:14:49Z</dc:date>
    </item>
  </channel>
</rss>

