ArcGIS10.0 desktop; 10.2 Feat Servcs in  WFS/SAFE Interoperability reproject to 4269

395
0
02-13-2014 11:24 AM
Ravichandran_M_Kaushika
Occasional Contributor
dear Readers,

most of the users in the field are using ArcGIS 10.0 (Win 7 - mostly 64bit) and the central office servers are in version 10.2. Data served from the feature services from these servers are not visible to arcgis 10.0 clients in the field. ArcGIS 10.1 client is able see these feature services.


But the field offices should remain in ArcGIS 10.0 for other application considerations.  So I was told that Interoperability Connections item in Catalog list is the way to go.

Using Add Interoperability connection menu, I was able to study how MyLayer.FDL file was created in <users>\AppData\Roaming\Safe Software\Interoperability folder and was able to programmatically create the .fdl file in the Safe Software directly as though it was created by hand using Add Interoperability connection command.  This automated process was created as an Add-in button.

Users liked what they saw till they started using the WFS layers.

Name of the fdl file was forced to be the tablename in from the authoritative data service.  Add in button would add the layer IGxLayer if the .lyr file was present with desired symbology. If the .lyr did not exist in the <users>\....\Interoperability folder, then users could drag it from the catalog window\Interoperability Connection listing for the 1st time. WFS layer is currently served out in 1 projection 4326 (WGS 1984).

Now users want the wfs layer data in 4269 projection to intersect using an existing enterprise arcobject application function - arobjects based function is not able to intersect with another 4269 (NAD 1983 Geog). The user have to load it in ArcMap/ArcCatalog UI to perform the intersection.

Sometime back one of ESRI tech reps told me that ArcMap UI engine is smart enough to do these intersects using different routes and the same functions/routes WILL not be available to arcobjects programmers.  that explains why the users will be able to intersect in ArcMap/ArcCatalog UI.

QUESTION:
1. How do i reproject the IGxLayer added from 4326 as served from the server to 4269 using ArcObjects?

2. Will ArcObjects treat WFS feature services layer very similar to a featurelayer?


code I have got... i will paste after i load the IGxLayer into TOC UI.

IGxLayer gxLayerCls = new ESRI.ArcGIS.Catalog.GxLayer();
IGxFile gxFile = (ESRI.ArcGIS.Catalog.IGxFile)gxLayerCls; //Explicit Cast.


gxFile.Path = strFile2BLoadedAsFeatLayerInParam;
_pMxDoc.AddLayer(gxLayerCls.Layer);
//Works GREAT TILL the above line.


IFeatureLayer2 featLayer2BReprojected = new FeatureLayerClass();
featLayer2BReprojected = (IFeatureLayer2)_pMxDoc.FocusMap.get_Layer(0);

ISpatialReferenceFactory pSpatialRefFact = new SpatialReferenceEnvironment(); 
ISpatialReference4 pSpatialRef ; //= new SpatialReferenceEnvironmentClass.

IGeographicCoordinateSystem2 pGeogCoordSysNAD83_4269 = (IGeographicCoordinateSystem2);

pSpatialRefFact.CreateGeographicCoordinateSystem(4269);


IGeoDataset pGeoDataset = (IGeoDataset)featLayer2BReprojected.FeatureClass;
//THIS pGeoDataset is empty.  STOPPED HERE.



IGeoDatasetSchemaEdit2 pGeoDSSchema = (IGeoDatasetSchemaEdit2)pGeoDataset;
pGeoDSSchema.AlterSpatialReference(pGeogCoordSysNAD83_4269);


0 Kudos
0 Replies