HOW TO
Some workflows require the ability to work with one table or layer in ArcGIS containing multiple st_geometry attributes. Instructions provided describe how to create a table in Oracle with multiple st_geometry attributes, multiple st_geometry_index indexes, Oracle views, and how to register the views with ArcSDE to make the data accessible in ArcGIS.
Code:
SQL> CREATE TABLE spatial_objects
2 (objectid NUMBER(38) NOT NULL,
3 shape_pt sde.st_geometry,
4 shape_ln sde.st_geometry,
5 shape_py sde.st_geometry);
Table created.
Code:
SQL> INSERT INTO spatial_objects VALUES
2 (1, sde.st_point(1395735.6, 405588.4,1), NULL, NULL);
1 row created.
Code:
SQL> UPDATE spatial_objects SET
2 shape_ln = sde.st_linestring('linestring (1395735.6 405588.4, 1395767.3 405421.1)',1),
3 shape_py = sde.st_polygon('polygon ((1395652.5 405380.6, 1395652.5 405880.6, 1396152.5 405580.6,
4 1396152.5 405380.6, 1395652.5 405380.6))',1)
5 WHERE objectid = 1;
1 row updated.
SQL> COMMIT;
Code:
SQL> CREATE INDEX shape_pt_idx
2 ON spatial_objects (shape_pt)
3 INDEXTYPE IS sde.st_spatial_index
4 parameters ('st_grids=100 st_srid=1');
Index created.
SQL> CREATE INDEX shape_ln_idx
2 ON spatial_objects (shape_ln)
3 INDEXTYPE IS sde.st_spatial_index
4 parameters ('st_grids=100 st_srid=1');
Index created.
SQL> CREATE INDEX shape_py_idx
2 ON spatial_objects (shape_py)
3 INDEXTYPE IS sde.st_spatial_index
4 parameters ('st_grids=100 st_srid=1');
Index created.
Code:
SQL> CREATE OR REPLACE VIEW spatial_view_pt AS
2 SELECT objectid, shape_pt
3 FROM spatial_objects;
View created.
SQL> CREATE OR REPLACE VIEW spatial_view_ln AS
2 SELECT objectid, shape_ln
3 FROM spatial_objects;
View created.
SQL> CREATE OR REPLACE VIEW spatial_view_py AS
2 SELECT objectid, shape_py
3 FROM spatial_objects;
View created.
Code:
D:\> sdelayer -o register -l spatial_view_pt,shape_pt -e p -u tomb -i 5151 -t st_geometry -C objectid,user
ArcSDE 9.2 for Oracle10g Build 508 Thu Apr 17 12:23:18 2008
Layer Administration Utility
-----------------------------------------------------
Successfully Created Layer.
D:\> sdelayer -o register -l spatial_view_ln,shape_ln -e l -u tomb -i 5151 -t st_geometry -C objectid,user
ArcSDE 9.2 for Oracle10g Build 508 Thu Apr 17 12:23:18 2008
Layer Administration Utility
-----------------------------------------------------
Successfully Created Layer.
D:\> sdelayer -o register -l spatial_view_py,shape_py -e a -u tomb -i 5151 -t st_geometry -C objectid,user
ArcSDE 9.2 for Oracle10g Build 508 Thu Apr 17 12:23:18 2008
Layer Administration Utility
-----------------------------------------------------
Successfully Created Layer.
Get help from ArcGIS experts
Download the Esri Support App