Attempting to Serve Features using a Spatial View from ArcSDE on SQL Server

980
1
07-03-2014 01:30 PM
JeffMitzelfelt
New Contributor III
I�??m trying to serve up a feature service with ArcGIS Server 10.1 using a spatial view which is combining data from a feature class and a view that is in turn getting data from a linked server.

The last spatial view I made I used:

-Right click on Data Server Connection and select New.. View..
-Added info to �??Create New View�?? Dialog box
--View Name �?? spVwNewView
--View Definition �??
select
    AcesSites.objectid as ObjectId,
    AcesSites.shape as Shape,
    vwPermitDemographics.rid as Rid,
    vwPermitDemographics.siteid as SiteId,
    vwPermitDemographics.mediacode as MediaCode,
    vwPermitDemographics.interesttype as InterestType,
    vwPermitDemographics.EjScore as EjScore,
    vwPermitDemographics.CountyFips as CountyFips,
    vwPermitDemographics.FederalDist as FederalDist,
    vwPermitDemographics.StateHouseDist as StateHouseDist,
    vwPermitDemographics.SenateDist as SenateDist
from AcesSites right join vwPermitDemographics on AcesSites.rid = vwPermitDemographics.rid

--Click OK
-Checked view in ArcCatalog. Looks great
-Checked AcesSites layer description
--sdelayer �??o describe_long �??l AcesSites,shape �??i sde:sqlserver:ServerName -D DatabaseName -u OwnerId -p OwnerPassword
---Results
----SRID .................: 10
----Layer Envelope .......:
-----minx:    829100.56925,        miny:   1231910.70573
-----maxx:   1171534.30610,        maxy:   1848117.29983
----Layer Type ...........: In-Line Spatial Type/GEOMETRY
-Register view with sdelayer �??o register
--sdelayer -o register -l spVwNewView,shape -e p -t GEOMETRY -E 829100.56925,1231910.70573,1171534.30610,1848117.29983 -R 10 -C objectid -S "Permit Points with Demographics" �??i sde:sqlserver:ServerName -D DatabaseName -u OwnerId -p OwnerPassword
---Results �?? successfully added layer
-Attempt to build feature service with spVwNewView
--No  problem adding the layer to the mxd and display.
--Problem starts when I try to Share as Service
---Analyze give an error
----High       Unresolved        00059    Layer�??s data source is not registered with the geodatabase

Any guidance would be appreciated.
0 Kudos
1 Reply
JeffMitzelfelt
New Contributor III

Well I think finally got this figured out.

  • - Right click on Data Server Connection and select New.. View..
  • Add info to ‘Create New View’ Dialog box
    • View Name - spVwNewView
    • View Definition -
      • Select
          PermitSites.objectid as ObjectId,
          PermitSites.shape as Shape,
          vwPermitDemographics.rid as Rid,
          vwPermitDemographics.siteid as SiteId,
          vwPermitDemographics.mediacode as MediaCode,
          vwPermitDemographics.interesttype as InterestType,
        from PermitSites right join vwPermitDemographics on PermitSites.rid = vwPermitDemographics.rid
    • Click OK
  • Check PermitSites layer description with command line tool
    • sdelayer –o describe_long –l PermitSites,shape –i sde:sqlserver:ServerName -D DatabaseName -u OwnerId -p OwnerPassword
      • SRID ..........: 10
      • Layer Envelope .......:
        • minx: 829100.56925,        miny: 1231910.70573
        • maxx: 1171534.30610,        maxy: 1848117.29983
      • Layer Type ...........: In-Line Spatial Type/GEOMETRY
  • Register view with command line tool
    • sdelayer -o register -l spVwNewView,shape -e p -t GEOMETRY -E 829100.56925,1231910.70573,1171534.30610,1848117.29983 -R 10 -C objectid -S "Permit Points with Demographics" –i sde:sqlserver:ServerName -D DatabaseName -u OwnerId -p OwnerPassword
  • Right click on the view in ArcCatalog
    • Select "Manage..." - "Register with Geodatabase" (Option was grayed out before previous step)
  • View should now be ready to build and deploy service.
0 Kudos