<?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: Is line on polygon boundary flag in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249861#M717</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp; Very much appreciate your assistance on this!&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 13:13:10 GMT</pubDate>
    <dc:creator>Jake_S</dc:creator>
    <dc:date>2023-01-20T13:13:10Z</dc:date>
    <item>
      <title>Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249038#M702</link>
      <description>&lt;P&gt;Is it possible to create a rule that flags polylines if it intersects along the boundary of a polygon.&lt;/P&gt;&lt;P&gt;I know I can get this if it intersects anywhere with &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#intersects" target="_self"&gt;Intersects()&lt;/A&gt;. Yet trying to create it if the line runs along the boundary.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.jpg" style="width: 501px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60635i073AE1ED3831D4EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example.jpg" alt="Example.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;~jake&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 13:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249038#M702</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2023-01-18T13:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249184#M705</link>
      <description>&lt;P&gt;Try &lt;A href="https://developers.arcgis.com/arcade/function-reference/geometry_functions/#touches" target="_blank" rel="noopener"&gt;Touches()&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Can't test right now, but something like this could work:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// load polygons
var polygons = FeaturesetByName(...)

// get intersecting polygons
var i_polygons = Intersects(polygons, $feature)

// return 1 at the first touching polygon
for(var i_poly in i_polygons) {
    if(Touches(i_poly, $feature)) { return 1}
}
// else return 0
return 0&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 18 Jan 2023 18:48:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249184#M705</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-18T18:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249432#M707</link>
      <description>&lt;P&gt;Jake,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Take a look at&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 13:01:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249432#M707</guid>
      <dc:creator>MikeMillerGIS</dc:creator>
      <dc:date>2023-01-19T13:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249446#M708</link>
      <description>&lt;P&gt;Thanks for the input. Unfortunately this doesn't give the output I'm looking for&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JS_Esri_0-1674135420003.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60726i630C6CD9CFA8FD61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JS_Esri_0-1674135420003.png" alt="JS_Esri_0-1674135420003.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I applied the rule to the Parcel Lines to check if the line was on the PlatIndex boundary (which is a polygon) for ease of viability. As you can see the non-intersecting (red) feature works as expected but the other (green) indicates its on the boundary. I'm looking to get a contiguous overlap.&lt;BR /&gt;&lt;BR /&gt;A collogue and I came up with this code below but I cant get past the 3rd line of code "&amp;nbsp;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;vertBndry&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Geometry&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;polygonFeature&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;rings&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;];" returning an error of "unexpected null". I may not be able to get the rings of an intersected polygon feature. If use the the same logic on a polygon feature class "&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;vertBndry&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Geometry&lt;/SPAN&gt;&lt;SPAN&gt;($f&lt;/SPAN&gt;&lt;SPAN&gt;eature&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;rings&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;];" it works just fine. Not sure if there is a limitation to the applied feature.&lt;BR /&gt;&lt;BR /&gt;The idea of this script convert polygon rings to line segments and check the vertices&amp;nbsp;of the parcel line against the ring lines. If all the vertices of the parcel line fall on the converted ring lines it is on the boundary.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var polygonFeature = Intersects(FeatureSetByName($datastore, 'PlatIndex'),$feature)
var vertFeat = Geometry($feature).paths[0][0];
var vertBndry = Geometry(polygonFeature).rings[0];

var cnt_vertFeat= count(vertFeat);
var cnt_vertBndry = count(vertBndry)    // number of verticies in ring

if (vertFeat &amp;gt; 1 &amp;amp;&amp;amp; vertBndry &amp;gt; 1) {
    for (var vb = 0; vb &amp;lt; cnt_vertBndry; vb++)  {
        var polylineJSON = {
            "paths": [vb, vb+1],
            "spatialReference": { "wkid": 3857 }
          };
          var line = Polyline(polylineJSON);
        var onbndry = 1
        for (var vf = 0; vf &amp;lt; cntVert; vf++){
            var intCnt = Intersects(point(verts[vf]),line)
            onbndry = 0 
            if (intCnt&amp;lt;1) {
                break
            }
        }
        if (onbndry==1) {
            return onbndry
        }
    }
    return onbndry
}
return 0&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Any thoughts? How to get past the error or any other possible alternatives?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks Johannes!&lt;BR /&gt;&lt;BR /&gt;~jake&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 13:47:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249446#M708</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2023-01-19T13:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249831#M715</link>
      <description>&lt;P&gt;OK, so using the geometries to do this turns out to be a bit more complicated than Touches()...&lt;/P&gt;&lt;P&gt;A line completely lies on a polygon's boundary if&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;each vertex of the line touches the polygon&lt;/LI&gt;&lt;LI&gt;there are no polygon vertices that do not touch the line inbetween vertices that do&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Maybe it can be done easier, but that's the way it worked for my test cases...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// get all intersecting polygons
var polygons = FeaturesetByName($datastore, "TestPolygons")
var i_polygons = Intersects(polygons, $feature)

for(var i_poly in i_polygons) {
    // check if each vertex of $feature is on boundary
    // if not, go to the next i_poly
    var vertices = Geometry($feature).paths[0]
    var vertices_on_boundary = true
    for(var v in vertices) {
        if(!Touches(vertices[v], i_poly)) {
            vertices_on_boundary = false
            break
        }
    }
    if(!vertices_on_boundary) { continue }

    // check if there are polygon vertices that do not touch the line inbetween vertices that do
    // if not, the line coincides with the polygon boundary
    var vertices = Geometry(i_poly).rings[0]
    var status = "not touching"
    for(var v in vertices) {
        if(Intersects(vertices[v], $feature)) {
            if(status == "not touching") { status = "touching" }
            if(status == "not touching anymore") { status = "error"; break }
        } else {
            if(status == "touching") { status = "not touching anymore" }
        }
    }
    if(status != "error") { return 1 }
}
return 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it can be done much, muuuuch easier with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp;'s suggestion of Relate. The &lt;A href="https://en.wikipedia.org/wiki/DE-9IM" target="_blank" rel="noopener"&gt;DE-9IM model&lt;/A&gt; is completely new to me, but I found the right expression quite fast by drawing the matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var polygons = FeaturesetByName($datastore, "TestPolygons")
var i_polygons = Intersects(polygons, $feature)

for(var i_poly in i_polygons) {
    if(Relate(i_poly, $feature, "FF*TT*FF*")) { return 1 }
}
return 0&lt;/LI-CODE&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;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1674207686255.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60816iA27F8BB1FB693E95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1674207686255.png" alt="JohannesLindner_0-1674207686255.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;</description>
      <pubDate>Fri, 20 Jan 2023 09:43:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249831#M715</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-01-20T09:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249860#M716</link>
      <description>&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. I think this might work but the documentation for this and&amp;nbsp;Dimensionally Extended 9-Intersection Model is very lacking in general. Have you used this before?&lt;BR /&gt;&lt;BR /&gt;~jake&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 13:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249860#M716</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2023-01-20T13:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is line on polygon boundary flag</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249861#M717</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/188597"&gt;@MikeMillerGIS&lt;/a&gt;&amp;nbsp; Very much appreciate your assistance on this!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 13:13:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/is-line-on-polygon-boundary-flag/m-p/1249861#M717</guid>
      <dc:creator>Jake_S</dc:creator>
      <dc:date>2023-01-20T13:13:10Z</dc:date>
    </item>
  </channel>
</rss>

