Oracle Locator (SRID) and SDELAYER Registration

287
7
04-18-2011 06:36 AM
AndrewCox
New Contributor II
Hello,

Please can someone help?

I have loaded some data into Oracle Locator using the SRID of 81989. I want to register these layers with SDE as 27700. Do I need to do anymore than the following as I want to avoid any on-the-fly data reprojection when I publish the layer as an ArcGIS Server map service:

sdelayer -o register -l STATIONS,POINT -e np -t SDO_GEOMETRY -C OBJECTID,USER -G 27700 -k VL -P HIGH -i SDE:ORACLE11G -u MYUSER -p MYUSER@MYTNS

When viewing the data in ArcMap alongside some other data that I loaded direct into ArcSDE, ArcMap seems to think this data is in a different projection.

I am using direct connect.

Thanks
Andy
0 Kudos
7 Replies
VinceAngelo
Esri Esteemed Contributor
For good or for bad (more the latter IMHO), ArcSDE ignores the '-G' coordsys in favor of the
Oracle coordinate string.  {UNSUPPORTED  RISK="MediumLow"} If it causes me too much
grief,  I manually edit the layer's SRID to point to a coordinate reference with the appropriate
PE coordsys (just make sure the other parameters are appropriate){/UNSUPPORTED}

- V
0 Kudos
AndrewCox
New Contributor II
Vince,

Thanks very much for the reply. Please can I just confirm that the process I need to follow would be something like:

1. Load the data into Oracle using the SRID 81989.

2. Use sdelayer -o register with the correct params e.g. -x etc.

3. Use the sdelayer -o describe_long to find the SRID key that the layer was registered with SDE.

4. Open the SPATIAL_REFERENCES table in the SDE schema and change the SRTEXT entry to match watch it should be for 27700 e.g.
PROJCS["British_National_Grid",GEOGCS["GCS_OSGB_1936",DATUM["D_OSGB_1936",SPHEROID["Airy_1830",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]

As an alternative I presume I could also add a new entry into the SPATIAL_REFERENCES table first and then use the -R <SRID> option on sdelayer -o register specifying the key to the record I just added to the SPATIAL_REFERENCES table e.g.

sdelayer -o register -l <table,column> -e <entity_mask> -t <storage_type>
{[-C <row_id_column>[,{SDE|USER}[,<min_ID>]]]} [Spatial_Index]
[-E <{empty | xmin,ymin,xmax,ymax}>] [{-R <SRID> | [Spatial_Ref_Opts]}]
[-S <layer_description_str>] [-k <config_keyword>]
[-i <service> | <port#> | <direct connection>] [-s <server_name>]
[-D <database_name>] -u <DB_user_name> [-p <DB_user_password>] [-q]

Cheers
Andy
0 Kudos
AndrewCox
New Contributor II
Vince,

Sorry another quick question.

How does ArcGIS know that two layers have the same spatial reference when determining whether to re-project data? Does it compare two layers SRID keys from the SPATIAL_REFERENCES table or does it do some kind of comparison on the SRTEXT entry?

Thanks
Andy
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Rather than changing the SRTEXT, I change the SRID in layers and geometry_columns to
match the coordref with the SRTEXT I'm trying to match.

I haven't tried using a '-R' to work around this, but I doubt it would work.

pe_coordsys_eq does a string comparison.

- V
0 Kudos
AndrewCox
New Contributor II
Vince,

Ok thanks.

I may have to do it the other way round as I'm not sure I'll have an existing entry in the SPATIAL_REFERENCES table which I can use. Therefore, I'll have to update the SRTEXT etc to reflect the params I want for my new layers.

Just as an aside, I don't suppose you know where the "Spatial Reference: 4326" comes from that gets reported against a layer through the REST API e.g. http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapSe.... Is this derived from the MXD or from the entries in the SDE tables.

For example, for my layer the REST API reports:

"Spatial Reference: PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM["OSGB 1936 (EPSG ID 6277)",SPHEROID["Airy 1830 (EPSG ID 7001)",6377563.396,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",400000.0],PARAMETER["False_Northing",-100000.0],PARAMETER["Central_Meridian",-2.0],PARAMETER["Scale_Factor",0.9996012717],PARAMETER["Latitude_Of_Origin",49.0],UNIT["Meter",1.0]]"

and I want it to read 27700?


Thanks
Andy
0 Kudos
VinceAngelo
Esri Esteemed Contributor
If you don't have a layer with the desired coordref, create one (dummy table, sdelayer -add...).
Hacking the SRTEXT is a much riskier activity; doing so is likely to corrupt your ArcSDE instance.

4326 is PE_GCS_WGS_1984.

- V
0 Kudos
MelitaKennedy
Esri Notable Contributor
Rather than changing the SRTEXT, I change the SRID in layers and geometry_columns to
match the coordref with the SRTEXT I'm trying to match.

I haven't tried using a '-R' to work around this, but I doubt it would work.

pe_coordsys_eq does a string comparison.

- V


pe_coordsys_eq does compare the names in the two coordinate systems, which are strings, but the objects are compared so that the number equivalency is easier to calculate.
0 Kudos