Oracle 18c; 10.7.1 EGDB; SDE.ST_GEOMETRY
I can generate a feature using SQL that has a Nil (zero-vertex) geometry:
select shape, (shape).points as geometry, sde.st_area(shape) as area, sde.st_isempty(shape) as is_empty, (shape).entity, sde.st_entity(shape), (shape).numpts from (select sde.st_polyfromtext('POLYGON EMPTY') as shape from dual)
As shown, there seem to be two different ways of determining the entity number using SQL:
0 | nil shape |
1 | point |
2 | line (includes spaghetti lines) |
4 | linestring |
8 | area |
257 | multipoint |
258 | multiline (includes spaghetti lines) |
260 | multilinestring |
264 | multiarea |
Why does (SHAPE).ENTITY return a different value than SDE.ST_ENTITY(SHAPE)?
Should (SHAPE).ENTITY be 0, not 16, to indicate that the geometry is Nil?
Solved! Go to Solution.
Esri Case #03475191 - SDE.St_Geometry: Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)?
...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:
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:
https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-numpoints.htm
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.
Esri Case #03475191 - SDE.St_Geometry: Why is (SHAPE).ENTITY different from SDE.ST_ENTITY(SHAPE)?
...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:
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:
https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/st-numpoints.htm
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.