Environment:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
ArcSDE 10.0 for Oracle11g
Using st_geometry as the spatial column datatype.
I pre-create my table in sql with just my attribute columns, then use sdelayer -o add to add the objectid and st_geometry columns, using -R 30 to set the srid:
sdelayer -o add -l skate_park,shape -e a -t ST_GEOMETRY -R 30 -E 640000,6000000,740000,6120000 -C objectid,SDE -P HIGH -s prdapp008 -u cgdweb -p *****
Both SRIDs 30 and 45 are defined in st_spatial_references:
select srid, sr_name from st_spatial_references where srid in (30,45);
SRID SR_NAME
---------- ----------------------
30 GDA_1994_MGA_Zone_55
45 ACT Stromlo Grid
After the sdelayer command, querying st_geometry_columns shows the srid has been set to 45, not 30:
select column_name, geometry_type, srid from st_geometry_columns
where owner = 'CGDWEB' and table_name = 'SKATE_PARK';
COLUMN_NAME GEOMETRY_TYPE SRID
-------------------------------- -------------------------------- ----------
SHAPE ST_GEOMETRY 45
Using sdelayer -o alter ... -P HIGH -R 30 ... makes no change.
After I insert data in which the srid is set to 30 and then try to create a spatial index specifying srid 30 I get an error:
create index skate_park_idx0
on cgdweb.skate_park (shape)
indextype is sde.st_spatial_index
parameters('st_grids=100, 0, 0 st_srid=30');
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20085: Parameter ST_SRID 30 is different from ST_GEOMETRY_COLUMNS srid
(45).
ORA-06512: at "SDE.SPX_UTIL", line 1015
ORA-06512: at "SDE.ST_DOMAIN_METHODS", line 1319
Using sdetable -o create to create the table instead of pre-creating it in sql gives the same result. Somehow srid 45 seems to be the local default!
If I pre-create the table including the objectid and shape columns in sql and then use sdelayer -o register, the correct srid is set and the index creation does not error. However only some of my records show when browsing the attribute table in ArcMap and are selectable. Other records appear on the map but are not selectable. Hence my attempts to allow sdelayer to add the objectid and shape columns.
Any suggestions?