概述
引用 using ESRI.ArcGIS.Geoprocessor;
(1)输入路径
private bool Excute()
{
bool result = true;
ESRI.ArcGIS.AnalysisTools.Intersect intersect = new ESRI.ArcGIS.AnalysisTools.Intersect();
intersect.in_features =
txtlayer1.Text+";"+txtlayer2.Text;
intersect.out_feature_class = CheckFileName(_outfilepath);
Geoprocessor geoProcessor = new Geoprocessor();
try
{
geoProcessor.Execute(intersect, null);
}
catch(Exception ex)
{
result = false;
}
return result;
}
(2)输入featureclass
Geoprocessor geoprocessor = new Geoprocessor();
geoprocessor.OverwriteOutput = true;
ESRI.ArcGIS.AnalysisTools.Intersect intersect = new ESRI.ArcGIS.AnalysisTools.Intersect();
IGpValueTableObject gpValueTableObject = new GpValueTableObjectClass();//对两个要素类进行相交运算
gpValueTableObject.SetColumns(2);
object o1 = featureClass1;//输入IFeatureClass 1
object o2 = featureClass2;//输入IFeatureClass 2
gpValueTableObject.AddRow(ref o1);
gpValueTableObject.AddRow(ref o2);
intersect.in_features = gpValueTableObject;
intersect.out_feature_class = @"shp存放路径test.shp";
geoprocessor.Execute(intersect, null);
最后
以上就是坦率花生为你收集整理的调用gp工具-相交的全部内容,希望文章能够帮你解决调用gp工具-相交所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复