首页 > 其他 > 详细

Engine中执行gp工具返回的要素图层如何获取?

时间:2016-02-23 11:16:36      阅读:140      评论:0      收藏:0      [点我收藏+]

来自:http://zhihu.esrichina.com.cn/?/question/12087

Engine中执行gp工具返回的【解决办法】:
需要用gpUtils.DecodeFeatureLayer方法将gp工具生成的图层先读取出来,如:

// Intialize the geoprocessor.
Geoprocessor GP = new Geoprocessor();

// Intialize the MakeFeatureLayer tool.
MakeFeatureLayer makefeaturelayer = new MakeFeatureLayer();

// Set up the GP tool parameters and run the tool.
makefeaturelayer.in_features = @C:\gp\nfld.gdb\wells;
makefeaturelayer.out_layer = Wells_Lyr;
makefeaturelayer.where_clause = WELL_YIELD > 150;

IGeoProcessorResult result = (IGeoProcessorResult)GP.Execute(makefeaturelayer, null);

IFeatureClass fc;
IQueryFilter qf;

IGPUtilities gpUtils = new GPUtilitiesClass();
gpUtils.DecodeFeatureLayer(result.GetOutput(0), out fc, out qf);

IFeatureCursor cursor = fc.Insert(true);

要素图层如何获取?比如make query layer工具

Engine中执行gp工具返回的要素图层如何获取?

原文:http://www.cnblogs.com/gisoracle/p/5209124.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!