Find multi-part features using SQL (ST_GEOMETRY)

65
1
06-25-2022 08:41 PM
Bud
by
Regular Contributor II

How can I query for multi-part features in an SDE.ST_GEOMETRY FC using SQL? (in the Select By Attributes window or in a definition query)

 

 

Tags (1)
0 Kudos
1 Reply
Bud
by
Regular Contributor II

Use this WHERE clause in a definition query or the Select By Attributes window:

 sde.st_numgeometries(shape) > 1

 

There is a known bug in versioned Oracle SDE.ST_GEOMETRY FCs. The above WHERE clause will throw an error: ORA-00904 Invalid Identifier "SHAPE".

  • Defect #: BUG-000150273
    "ST_GEOMETRY functions used in Select By Attributes tool on Shape field generate error "ORA-00904 Invalid Identifier "SHAPE""
  • Esri Canada case #: 03080875

 

Workaround:

Use a subquery.

objectid in 
(select
objectid
from
my_owner.my_fc
where
sde.st_numgeometries(shape) > 1)

 

That bug only happens for SDE.ST_GEOMETRY.

Whereas if the FC was SDO_GEOMETRY, then spatial functions would work fine — even if the FC was versioned.

sdo_util.getnumelem(shape) > 1