• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

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

来自: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工具

posted on 2016-02-23 10:42  gisai  阅读(741)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3