首页 新闻 会员 周边 捐助

关于IMapAlgebraOp接口的栅格相减

0
悬赏园豆:10 [已关闭问题] 关闭于 2012-09-02 09:58

做一个ArcEngine的小程序,用到IMapAlgebraOp接口进行栅格数据相减,自己写了个栅格求差的函数,如下所示。只是不知道为什么计算完了之后的结果不是差值,很诡异的一个栅格,不知道怎么计算出来的。不知道各位大侠有没有遇到过类似的问题?求助

 1 public IRaster QiuCha(IRaster oldDEM, IRaster newDEM,
 2             string filepath,string filename)
 3         {
 4             IMapAlgebraOp mapAlgebraOp = new RasterMapAlgebraOpClass();
 5             IRasterAnalysisEnvironment env = mapAlgebraOp as IRasterAnalysisEnvironment;
 6             IWorkspaceFactory workspaceFactory = new RasterWorkspaceFactoryClass();
 7             IWorkspace workspace = workspaceFactory.OpenFromFile(filepath, 0);
 8             env.OutWorkspace = workspace;
 9 
10             mapAlgebraOp.BindRaster(oldDEM as IGeoDataset, "old");
11             mapAlgebraOp.BindRaster(newDEM as IGeoDataset, "new");
12 
13             IRaster pRasterOut;
14             pRasterOut = mapAlgebraOp.Execute("Abs([old] - [new])") as IRaster;
15             SaveRraster(pRasterOut, workspace, filename, "TIFF");
16             mapAlgebraOp.UnbindRaster("old");
17             mapAlgebraOp.UnbindRaster("new");
18             mapAlgebraOp = null;
19             workspace = null;
20             return pRasterOut;
21         }
DayDreamInGIS的主页 DayDreamInGIS | 菜鸟二级 | 园豆:206
提问于:2012-08-30 21:53
< >
分享
所有回答(1)
0

请问你是怎么解决的呢

xiyatuyun | 园豆:202 (菜鸟二级) | 2015-06-18 10:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册