Registering Spatial View

3445
5
Jump to solution
07-09-2012 07:49 PM
ShaunWeston
Occasional Contributor
I'm having trouble registering a spatial view. I have setup a view in SQL Server between a feature class and a business table, so I have a view in SQL server showing the feature class joined to the business table and would then like to see this spatially in ArcGIS Desktop. I thought the next step would be to register it using sdelayer -o register command, but just can't get it to work. I've got this:

sdelayer -o register -l gis.View_Sewers,Shape -e l
-t GEOMETRY -C UNITID -D UTILITIES -i sde:sqlserver:GISDEV
-u GISCREATOR -p GISCREATOR

This gives me an error saying  invalid column data type, so I thought this would be pretty basic, but can't seem to get my view to work?

So, UNITID is the main ID in the business table. I noticed that after I make my view in SQL Server, I can see it in ArcCatalog, however it's not registered.
1 Solution

Accepted Solutions
VinceAngelo
Esri Esteemed Contributor
In order to register a spatial view:
1) The geometry column must be a native geometry type (not SDEBINARY/SDELOB)
2) A registered rowid column (NOT NULL, unique, which maps to SE_INT32_TYPE) must exist
3) It must only reference column types supported by ArcSDE, and
4) It must be registered by the owner of the view

Your 'sdelayer' example has several issues:
1) The view owner was not used to register
2) You didn't specify coordinate reference parameters (-R or -x/-G/...)
3) You used the SIMPLE_LINE type for data that may not conform to that more rigorous
standard, and didn't permit multi-part shapes (+)

It would probably be instructive to use 'sdelayer -o stats' on the geometry source table
and 'sdetable -o describe' on the view, to see which "column data type" may be invalid.

- V

View solution in original post

0 Kudos
5 Replies
VinceAngelo
Esri Esteemed Contributor
In order to register a spatial view:
1) The geometry column must be a native geometry type (not SDEBINARY/SDELOB)
2) A registered rowid column (NOT NULL, unique, which maps to SE_INT32_TYPE) must exist
3) It must only reference column types supported by ArcSDE, and
4) It must be registered by the owner of the view

Your 'sdelayer' example has several issues:
1) The view owner was not used to register
2) You didn't specify coordinate reference parameters (-R or -x/-G/...)
3) You used the SIMPLE_LINE type for data that may not conform to that more rigorous
standard, and didn't permit multi-part shapes (+)

It would probably be instructive to use 'sdelayer -o stats' on the geometry source table
and 'sdetable -o describe' on the view, to see which "column data type" may be invalid.

- V
0 Kudos
ShaunWeston
Occasional Contributor
Thanks for the response:

I didn't realise this:


1) The geometry column must be a native geometry type (not SDEBINARY/SDELOB)

So, if you wanted to create a spatial view between a feature class in SDE BINARY and a business table, how would you do that? would you have to create it through this command "
-o create_view" instead of through SQL server?

0 Kudos
VinceAngelo
Esri Esteemed Contributor
Yes, that's pretty much why 'sdetable -o create_view' exists ('create_view' only for
SDEBINARY/SDELOB, 'register' only for native). If your view is complex, use phantom
tables of the right column types to create the view, then edit it to point to the
correct tables (with correct SQL).

- V
0 Kudos
RobertHu
New Contributor II
I wonder why you need to register a SDE spatial view. I use 'sdetable -o create_view' to create SDE spatial views a lot. Never register the views after creation. They seem working fine with ArcGIS (i.e. ArcCatalog, ArcMap, GP tools).
0 Kudos
VinceAngelo
Esri Esteemed Contributor
It's an either-or situation (create_view populates a row in the layers table if a SE_SHAPE_TYPE
column is present [provided that column is itself registered, otherwise an error]).

- V
0 Kudos