<?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: Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)? in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/why-is-shape-entity-different-from-sde-st-entity/m-p/1345161#M8670</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Case #03475191 - SDE.St_Geometry: Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)?&lt;/P&gt;&lt;P&gt;...it looks like the ST_Entity function is taking the entity member field from the ST_Geometry entry and providing the corresponding return based on a calculation. As you can see in the following screenshot, when the numpts value and len value are 0, the value in the entity member field is disregarded:&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="Bud_0-1698948897769.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84872iF0CCFC472C7CE207/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1698948897769.png" alt="Bud_0-1698948897769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As the ST_Entity function is providing the correct result for this geometry type (0 for nil), it is likely that the way nil values are stored in the entity member field isn't documented in the same way that something like ST_NumPoints is, where an explanation of these differences between the function and the attribute is provided:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1698948897774.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84871i85099BD83B46D308/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_1-1698948897774.png" alt="Bud_1-1698948897774.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-numpoints.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-numpoints.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The value 16 apepars to be a result of a bitmask operation but it gets a bit difficult to track down the function logic in the ST_GEOM_UTIL procedure and unfortunately there is no published reference.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2023 18:16:26 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-11-02T18:16:26Z</dc:date>
    <item>
      <title>Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-shape-entity-different-from-sde-st-entity/m-p/1343975#M8664</link>
      <description>&lt;P&gt;&lt;EM&gt;Oracle 18c; 10.7.1 EGDB; SDE.ST_GEOMETRY&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I can generate a feature using SQL that has a Nil (zero-vertex) geometry:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1698771468853.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84583i6294A3BF5B37E9E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1698771468853.png" alt="Bud_0-1698771468853.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select
    shape,
    (shape).points as geometry,
    sde.st_area(shape) as area,
    sde.st_isempty(shape) as is_empty,
&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;    (shape).entity,
    sde.st_entity(shape),&lt;/FONT&gt;&lt;/STRONG&gt;
    (shape).numpts
from
    (select 
        sde.st_polyfromtext('POLYGON EMPTY') as shape
    from 
        dual)  &lt;/PRE&gt;&lt;P&gt;As shown, there seem to be two different ways of determining the entity number using SQL:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;(SHAPE).ENTITY&amp;nbsp;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-oracle/stgeometry-oracle.htm#:~:text=Type-,ENTITY,-NUMBER(38)" target="_self"&gt;ST_Geometry in Oracle&lt;/A&gt; —&amp;gt;&amp;nbsp;How ST_Geometry stores spatial data —&amp;gt; Entity&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/get-st-geometry-object-s-attribute/m-p/1174306" target="_self"&gt;Get ST_GEOMETRY object's attribute&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;SDE.ST_ENTITY(SHAPE)&lt;UL&gt;&lt;LI&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-entity.htm" target="_self"&gt;ST_Entity SQL function&lt;/A&gt;&lt;BR /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;0&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;nil shape&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;point&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;line (includes spaghetti lines)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;linestring&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;area&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;257&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;multipoint&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;258&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;multiline (includes spaghetti lines)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;260&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;multilinestring&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;264&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;multiarea&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Why does (SHAPE).ENTITY return a different value than SDE.ST_ENTITY(SHAPE)?&lt;/P&gt;&lt;P&gt;Should&amp;nbsp;(SHAPE).ENTITY be 0, not 16, to indicate that the geometry is Nil?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2023 18:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-shape-entity-different-from-sde-st-entity/m-p/1343975#M8664</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-10-31T18:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/why-is-shape-entity-different-from-sde-st-entity/m-p/1345161#M8670</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Case #03475191 - SDE.St_Geometry: Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)?&lt;/P&gt;&lt;P&gt;...it looks like the ST_Entity function is taking the entity member field from the ST_Geometry entry and providing the corresponding return based on a calculation. As you can see in the following screenshot, when the numpts value and len value are 0, the value in the entity member field is disregarded:&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="Bud_0-1698948897769.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84872iF0CCFC472C7CE207/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1698948897769.png" alt="Bud_0-1698948897769.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As the ST_Entity function is providing the correct result for this geometry type (0 for nil), it is likely that the way nil values are stored in the entity member field isn't documented in the same way that something like ST_NumPoints is, where an explanation of these differences between the function and the attribute is provided:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1698948897774.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/84871i85099BD83B46D308/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_1-1698948897774.png" alt="Bud_1-1698948897774.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-numpoints.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-numpoints.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The value 16 apepars to be a result of a bitmask operation but it gets a bit difficult to track down the function logic in the ST_GEOM_UTIL procedure and unfortunately there is no published reference.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 18:16:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/why-is-shape-entity-different-from-sde-st-entity/m-p/1345161#M8670</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-11-02T18:16:26Z</dc:date>
    </item>
  </channel>
</rss>

