[GIS] Not able to register spatial view with sde

arcgis-10.2enterprise-geodatabasesdelayerspatial-viewsql server

I am using 10.2 ArcGIS and SOL Server 2008 R2.
I have created a cross database spatial view in sql server using following syntax:

USE [pipelines]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [gis].[parcels_test] 
AS
SELECT     a.Shape, a.asmt as ASMT, meg_assor_rep.gis.megaview_ext.Owner, meg_assor_rep.gis.megaview_ext.StreetNum, 
        meg_assor_rep.gis.megaview_ext.StreetDir, meg_assor_rep.gis.megaview_ext.Street,  meg_assor_rep.gis.megaview_ext.StreetType, 
        meg_assor_rep.gis.megaview_ext.SpaceApt, meg_assor_rep.gis.megaview_ext.Community, meg_assor_rep.gis.megaview_ext.Zip, 
        meg_assor_rep.gis.megaview_ext.Mail1, meg_assor_rep.gis.megaview_ext.Mail2, meg_assor_rep.gis.megaview_ext.Mail3, 
        meg_assor_rep.gis.megaview_ext.Mail4, meg_assor_rep.gis.megaview_ext.Acres, meg_assor_rep.gis.megaview_ext.LandUse1, 
        meg_assor_rep.gis.megaview_ext.TRA, a.floor as Floor, a.OBJECTID, meg_assor_rep.gis.megaview_ext.Notes, 
        meg_assor_rep.gis.megaview_ext.StreetAddr,a.Shape.STArea() as Prcl_Size_SqFt,meg_assor_rep.gis.landuse.Descr
FROM       pipelines.gis.prcl a 
INNER JOIN meg_assor_rep.gis.megaview_ext ON a.asmt = meg_assor_rep.gis.megaview_ext.Asmt
LEFT OUTER JOIN meg_assor_rep.gis.landuse ON meg_assor_rep.gis.megaview_ext.LandUse1 = meg_assor_rep.gis.LandUse.LandUseCode
GO

view created successfully however, when i am trying to register it with sde using following command it is giving me invalid entity(29) error.

sdelayer -o register -l pipeline_test,SHAPE -e a -k Geometry -t Geometry -i sde:SQLSERVER:GISDATA -D pipelines -p *** -u gis

This view includes a feature class of a parcel fabric dataset.
The interesting fact is that when i am trying to register view created on different feature classes (other than parcel fabric) using above command its getting registered successfully.

So, Its most probably the issue with parcel fabric.

Is there any specific prerequisite to follow before creating view on a parcel fabric feature class?

Best Answer

Without more information it's difficult to be positive, but the likely cause of your "invalid entity" error is an invalid entity (the geometry scan on the view found a nil or multi-part polygon when your -e parameter only allowed for single-part polygons).

The safest way to create views is to look at the properties of the feature class on which the view is based, and copy them to the sdelayer -o register command. Among the key properties that you didn't copy would have been the supported entities (likely "na+") and the coordinate reference parameter(s).

There are two ways to specify a coordinate reference, by using the -x, -P, and -G (and possibly -z or -m, if they're non-default), or by using the -R for the SRID of the source table for the view. If there are no registered tables with an appropriate existing COORDREF, then you'd need to run the -x/-P/-G/-z/-m gauntlet, the parameters for which are described in the Esri Understanding Coordinate Management in the Geodatabase whitepaper, but for WGS1984 data at ~1cm precsion would look like "-P HIGH -G 4326 -x -400,-400,10000000" .

You should also always explicitly name the registered rowid column and the fact that it is USER-set (in this case, with -C OBJECTID,USER). You should also verify that the rowid column does in fact represent a unique value after joins are applied (many-to-one is only permitted if a unique id off the "many" side is used for rowid).

In summary, I think your registration command should have looked like:

sdelayer -o register -l pipeline_test,SHAPE -e na+ -k Geometry -t Geometry ^
    -C OBJECTID,USER -R *N* -i sde:SQLSERVER:GISDATA -D pipelines -u gis -p ***