ESRI.ArcGIS.AnalysisTools.Intersect工具的in_features参数,其内容为求交的featureclass的完全名称列表,即包含盘符,路径和文件名称,所以当对SDE管理的图层进行Intersect时,这个参数要写的是SDE链接的字符串和图层名,如下例的
IWorkspaceName wsn = m_sdeWorkSpace.WorkspaceFactory.Create(strTempleSHPPath + "\\", strXMBHOID + ".sde", m_sdeWorkSpace.ConnectionProperties, 0);
File.SetAttributes(strTempSDECon, FileAttributes.Hidden);
ESRI.ArcGIS.esriSystem.IName name;
name = wsn as ESRI.ArcGIS.esriSystem.IName;
IWorkspace ws;
ws = name.Open() as IWorkspace;
Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
ESRI.ArcGIS.AnalysisTools.Intersect IntersectTools = new ESRI.ArcGIS.AnalysisTools.Intersect();
string LayerPath= null;
LayerPath= LayerPath+ "'" + strTempSDECon + @"\" + strLayerName1;";//去掉SDE链接符后的图层名
LayerPath= LayerPath+ "'" + strTempSDECon + @"\" + strLayerName2;
IntersectTools.in_features = LayerPath;
IntersectTools.out_feature_class = ws.PathName + @"\GH" + strXMBHOID;//结果featureclass
IntersectTools.join_attributes = "ALL";
IntersectTools.output_type = "INPUT";
object sev1 = 2;
try
{
gp.Execute(IntersectTools, null);
}
catch
{
gp.AddError(gp.GetMessages(ref sev1));
return;
}
本文介绍了如何利用ESRI ArcGIS Analysis Tools中的Intersect工具,对SDE管理的图层进行交集操作,并详细说明了相关代码实现过程。

1233

被折叠的 条评论
为什么被折叠?



