[GIS] ArcSDE – Registering table with Geography spatial column fails with error -138 (SQL Server 2008)

coordinate systementerprise-geodatabasespatial-databasesql server

I have a table of point features I am trying to register with ArcSDE (9.3.1 on SQL Server 2008) using the following command:

sdelayer -o register -l ThirdPartyWellsSurface,Shape -e np -C OBJECTID,SDE -t GEOGRAPHY -R 1047 -i sde:sqlserver:hou-sqldev10 -s hou-sqldev10 -D sde -u user -p pass

Where 1047 is a valid SRID (in the SDE_spatial_references table) for this data. It is failing with the error:

Error: The given coordinate references are incompatible (-138).
Error: Cannot Create Layer.

Looks like this used to be a bug back in 9.3 that got fixed. I checked and I do not have any null instances in the table. Googling and the ESRI sites didn't turn up much. Running a describe on a similar dataset with SRID of 1047 yields:

C:\WINDOWS\system32>sdelayer -o describe_long -l thirdpartywellssurfacetest,shap
e -i sde:sqlserver:hou-sqldev10 -s hou-sqldev10 -D sde -u user -p pass


ArcSDE 9.3.1  for SQL Server Build 1632 Thu Feb 26 12:05:37  2009
Layer    Administration Utility
-----------------------------------------------------
Layer Description ....: <None>
Database              : SDE
Table Owner ..........: SWNGIS
Table Name ...........: THIRDPARTYWELLSSURFACETEST
Spatial Column .......: SHAPE
Layer Id .............: 121155
SRID .................: 1047
Minimum Shape Id .....: 1
Offset ...............:
  falsex:       -400.000000
  falsey:       -400.000000
System Units .........: 1145324610.666666
Z Offset..............:          0.000000
Z Units ..............:          1.000000
Measure Offset .......: <None>
Measure Units ........: <None>
XY Cluster Tolerance .:          0.000000055879
Spatial Index ........:
  parameter:    SPIDX_GRID,GRID0=0.0178906151191854,FULL
  exist:        Yes
  array form:   0.0178906151191854,0,0
Layer Envelope .......:
  minx:      -124.52074,        miny:        24.45000
  maxx:       -72.80923,        maxy:        48.99887
Entities .............: npc
Layer Type ...........: SDE
Creation Date ........: 07/28/10 16:57:27
I/O Mode .............: NORMAL
Autolocking ..........: Enabled
Precision.............: High
User Privileges ......: SELECT, UPDATE, INSERT, DELETE
Coordinate System ....: GEOGCS["GCS_North_American_1927",DATUM["D_North_American
_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UN
IT["Degree",0.0174532925199433]]

And I know all of my points lie within that layer envelope:

alt text

Any ideas on what "The given coordinate references are incompatible (-138)" could be telling me here?

Best Answer

The geography data type only supports SRIDs that appear in the view sys.spatial_reference_systems. On my server, the SRID 1047 did not appear in that view so I suspect you are attempting to use a spatial reference that is incompatible with the geography data type.

Use the following query to see what SRIDs are supported:

select * from sys.spatial_reference_systems;

Bill