<?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: Difference between ST_IsClosed vs. ST_IsRing in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263060#M8300</link>
    <description>&lt;P&gt;It turns out the cul-de-sac in the second example is actually a multi-part feature:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1677686951178.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64051i12E0CA2A7060D33B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1677686951178.png" alt="Bud_0-1677686951178.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2023 16:09:19 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-03-01T16:09:19Z</dc:date>
    <item>
      <title>Difference between ST_IsClosed vs. ST_IsRing</title>
      <link>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263058#M8299</link>
      <description>&lt;P&gt;&lt;EM&gt;Oracle 18c; 10.7.1 Enterprise Geodatabase&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What's the difference between &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-isclosed.htm" target="_self"&gt;ST_IsClosed&lt;/A&gt; vs. &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-isring.htm" target="_self"&gt;ST_IsRing&lt;/A&gt;&amp;nbsp;in SDE.ST_Geometry?&lt;/P&gt;&lt;P&gt;For example, I want to query for lines that are near-circles like this:&lt;BR /&gt;&lt;EM&gt;(in other words, I want to select roundabouts)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1677681906203.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64028iAA7135DA158A3531/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1677681906203.png" alt="Bud_0-1677681906203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't want to select lines that close in on themselves midway like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1677681940390.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64029i7575405F4BBDFC27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_1-1677681940390.png" alt="Bud_1-1677681940390.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tested ST_IsClosed&amp;nbsp; and ST_IsRing. Both of the lines in the screenshots above were identified as closed &lt;U&gt;and&lt;/U&gt; as rings. So it's not clear to me what the difference between the two functions is.&lt;/P&gt;&lt;PRE&gt; objectid in (
    select
        objectid
    from
        roads
    where
        sde.st_is&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;Closed&lt;/FONT&gt;&lt;/STRONG&gt;(sde.st_geometryn(shape,1)) = 1
    )  &lt;/PRE&gt;&lt;PRE&gt; objectid in (
    select
        objectid
    from
        roads
    where
        sde.st_is&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Ring&lt;/STRONG&gt;&lt;/FONT&gt;(sde.st_geometryn(shape,1)) = 1
    )  &lt;/PRE&gt;&lt;P&gt;Reason for wrapping the WHERE clause in a subquery:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is an Esri bug where ST_GEOMETRY functions can’t be used in a SQL Expression (definition query, attribute table, etc.) when the FC is versioned. Wrapping the WHERE clause in a subquery lets us work around that bug.&lt;/LI&gt;&lt;LI&gt;Esri Case #03080875 - ST_GEOMETRY functions used in Select By Attributes tool on Shape field generate error "ORA-00904 Invalid Identifier "SHAPE"&lt;/LI&gt;&lt;LI&gt;BUG-000150273&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186467/highlight/true#M56563" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-questions/find-multi-part-features-using-sql-st-geometry/m-p/1186467/highlight/true#M56563&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 16:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263058#M8299</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-01T16:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between ST_IsClosed vs. ST_IsRing</title>
      <link>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263060#M8300</link>
      <description>&lt;P&gt;It turns out the cul-de-sac in the second example is actually a multi-part feature:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1677686951178.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/64051i12E0CA2A7060D33B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1677686951178.png" alt="Bud_0-1677686951178.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 16:09:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263060#M8300</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-01T16:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between ST_IsClosed vs. ST_IsRing</title>
      <link>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263097#M8301</link>
      <description>&lt;P&gt;I think the answer is: I should be using isRing. The word "Ring" is self-explanatory.&lt;/P&gt;&lt;P&gt;I was originally thrown off by the fact that some of my lines are multi-parts. So, an individual part could technically be a ring, even though the feature as a whole didn't appear to be a ring.&lt;BR /&gt;So, both of my example features were being identified as closed &lt;U&gt;and&lt;/U&gt;&amp;nbsp;as rings (my query only looked at the first part of multi-part features; in my examples, the first part was a ring).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've accounted for the multi-part quirk, and other quirks, in the following query:&lt;/P&gt;&lt;PRE&gt;objectid in (
    select
        objectid
    from
        roads
    where
        sde.st_numgeometries(shape) = 1   --Needs to be evaluated before isRing. Otherwise, isRing throws an error since it can't be used on multi-part features.
        and sde.st_is&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;Ring&lt;/STRONG&gt;&lt;/FONT&gt;(shape) = 1
        and name not like ('% CT')        --Some courts are literally just a loop with no straight portion. They are technically legitimate rings. So I'll omit them since I'm specifically looking for roundabouts, not courts.
        --and ownership = 'ABC'
        and sde.st_length(shape) &amp;lt;= 200   --If a road is longer than 200m, then it probably isn't a roundabout.&lt;BR /&gt;                                          --In the future, if needed, I could omit roads with this text in the name (similar to what I did with CT): PL, CIRCLE, DR, TRAIL, CRES, LOOP, SQUARE. &lt;BR /&gt;                                          --However, right now, that doesn’t seem to be necessary. Those road types get successfully excluded via the “must be shorter than 200m” criteria.&lt;BR /&gt;    )  &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 16:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263097#M8301</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-01T16:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between ST_IsClosed vs. ST_IsRing</title>
      <link>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263104#M8302</link>
      <description>&lt;P&gt;Is the following correct?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;All rings are closed, but not all closed are rings.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 16:01:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263104#M8302</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-01T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between ST_IsClosed vs. ST_IsRing</title>
      <link>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263359#M8304</link>
      <description>&lt;P&gt;According to the documentation you link to, ST_IsRing is a subset of ST_IsClosed that is also ST_IsSimple.&amp;nbsp; So, a ring must be closed but not all closed geometries have to be rings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 00:18:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/difference-between-st-isclosed-vs-st-isring/m-p/1263359#M8304</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2023-03-02T00:18:14Z</dc:date>
    </item>
  </channel>
</rss>

