AE+C# intersect 分析,老是弹出错误
public void Overlay_Intersect(string layername1, string layername2){
//分析图层
ILayer pLayer = Map.get_Layer(GetLayerIndex(layername1));
IFeatureLayer pInputFeatureLayer = pLayer as IFeatureLayer;
ITable pInputTable = pLayer as ITable;
IFeatureClass pInputFeatureClass = pInputFeatureLayer.FeatureClass;
//叠加图层
// pLayer = Map.get_Layer(GetLayerIndex(layername2));
ITable pOverlayTable = Map.get_Layer(GetLayerIndex(layername2)) as ITable;
IFeatureClassName pFeatClassName = new FeatureClassNameClass();
pFeatClassName.FeatureType = esriFeatureType.esriFTSimple;
pFeatClassName.ShapeFieldName = "shape";
pFeatClassName.ShapeType = pInputFeatureClass.ShapeType;
//工作空间
IWorkspaceName pNewWSName = new WorkspaceNameClass();
pNewWSName.WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory";
pNewWSName.PathName = "E://temp";
//数据集名称
// IDatasetName pDatasetName = pFeatClassName.FeatureDatasetName;
IDatasetName pDatasetName = pFeatClassName as IDatasetName;
pDatasetName.Name = "Intersect_result";
pDatasetName.WorkspaceName = pNewWSName;
double _tol = 0.01;
IBasicGeoprocessor pGBP;
pGBP = new BasicGeoprocessorClass();
IFeatureClass pOutputFeatClass;
pOutputFeatClass = pGBP.Intersect(pInputTable, false, pOverlayTable, false, _tol, pFeatClassName);
IFeatureLayer pOutputLayer = new FeatureLayer();
pOutputLayer.FeatureClass = pOutputFeatClass;
pOutputLayer.Name = pOutputFeatClass.AliasName;
Map.AddLayer((ILayer)pOutputLayer, 0);
}
执行到 pOutputFeatClass = pGBP.Intersect(pInputTable, false, pOverlayTable, false, _tol, pFeatClassName);
这一步时 弹出“对 COM 组件的调用返回了错误 HRESULT E_FAIL”
求各位大侠帮帮忙 --------------------编程问答-------------------- 我也碰到这个问题,请问楼主这个问题怎么解决的?
补充:.NET技术 , C#