在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
/// <summary> /// 调用GP工具对两个要素类做相交处理 /// </summary> /// <param name="featureClass1">优先级为1的要素类</param> /// <param name="featureClass2">优先级为2的要素类</param> /// <param name="outFeatureClassPath">输出结果要素类路径</param> private void DoIntersect(IFeatureClass featureClass1,IFeatureClass featureClass2,string outFeatureClassPath) { Geoprocessor gp = new Geoprocessor { AddOutputsToMap = false, OverwriteOutput = true }; IGpValueTableObject gpValueTable = new GpValueTableObjectClass(); gpValueTable.SetColumns(2); object rank = 1; object row = featureClass1; gpValueTable.SetRow(0, ref row); gpValueTable.SetValue(0, 1, ref rank); rank = 2; row = featureClass2; gpValueTable.SetRow(1, ref row); gpValueTable.SetValue(1, 1, ref rank); Intersect intersect = new Intersect { in_features = gpValueTable, out_feature_class = outFeatureClassPath, join_attributes = "ALL", output_type = "INPUT" }; if (gp.Execute(intersect, null) == null) throw new Exception("数据预处理失败!"); }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论