Create feature that has a shape, but geometry is null

422
2
10-31-2023 08:44 AM
Labels (1)
Bud
by
Notable Contributor

ArcGIS Pro 2.6.8; Oracle 18c; 10.7.1 EGDB; SDE.ST_GEOMETRY


It seems like there are four different states a feature can be in:

  1. Has shape and geometry. Normal polygon; visible in map.
    • Geometry's points blob can be considered a list of coordinates like "(1,2 3,4 5,6)".
  2. Has shape and geometry, but AREA and NUMPTS are zero (geometry is NIL/zero vertex).
  3. Has shape, but no geometry.
    • Geometry is null.
  4. Shape field is completely null.
    • Geometry is null.

Bud_0-1698766836737.png

select
    objectid,
    shape,
    (shape).points as geometry,
    sde.st_area(shape) as area,
    sde.st_isempty(shape) as is_empty,
    comment3,
    (shape).entity,
    sde.st_entity(shape),
    (shape).numpts
from
    infrastr.inf_record_sp

Question:

For testing purposes, how can I create a feature like the one in state #3, where the shape is not null, but the geometry is null?

I'm hoping to create such a feature using SQL. But I'm open to other techniques, too.

0 Kudos
2 Replies
Bud
by
Notable Contributor

I think I found a way to do it using SQL:

insert into infrastr.inf_record_sp (objectid, shape) values (
    sde.gdb_util.next_rowid('MY_OWNER', 'MY_TABLE'),                     --objectid
    sde.st_geometry(16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 300046, null)); --shape
commit;   

https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/next-rowid.htm

 

I can query the new row to see what it looks like. It is in state #3.

Bud_0-1699028304848.png

If I edit that row using ArcGIS Pro (even just edit a non-spatial field), then Pro will automatically change it to state #2: geometry is not null.

0 Kudos
Bud
by
Notable Contributor

It's also possible to import an XML Workspace Document that has features with "shape but no geometry". The geometry remains null upon import.

Of course, you'd need to have some features that are "shape but no geometry" to export in the first place. Importing an XML Workspace Document creates a new FC; we can't import to an existing FC.

0 Kudos