其他分享
首页 > 其他分享> > Arcgis Engine获取dem高程

Arcgis Engine获取dem高程

作者:互联网

1.根据名字找到图层

(2条消息) ArcGIS Engine遍历图层,获取指定的图层_shenzhenzhao的博客-CSDN博客icon-default.png?t=LA92https://blog.csdn.net/shenzhenzhao/article/details/102917240        使用上文的方法二

        或者使用下面的文献二方法

2.根据经纬度获取高程

        dem图层是栅格图层,有函数可以读取。

        private object GetDEMValue(double longitude, double latitude)
        {
            int row=0;
            int column=0;
            IRasterLayer lyr = layer_dem as IRasterLayer;
            IRaster rst = lyr.Raster;
            IRaster2 rst2 = rst as IRaster2;
            //将地图上的点的位置转换成行列号
            rst2.MapToPixel(longitude, latitude, out column, out row);
            object value = rst2.GetPixelValue(0, column, row);//0表示波段索引位置
            //MessageBox.Show("当前像元的列数为:" + column + "当前像元的行数为:" + row + " value为:" + value.ToString());
            return value;
        }

   上面函数得到的object不能强制转换为int,可以使用下面这个转换

value_dem = int.Parse(obj.ToString());

参考文献??????文献二

(2条消息) AE实现读取栅格数据的像元值_Zzzpiu的博客-CSDN博客icon-default.png?t=LA92https://blog.csdn.net/Zzzpiu/article/details/109199711(2条消息) C#+AE 栅格表面分析_dayuhaitang1的博客-CSDN博客icon-default.png?t=LA92https://blog.csdn.net/dayuhaitang1/article/details/106018175        上面第二个文档是提升功能。

标签:Engine,value,column,博客,Arcgis,dem,图层,row
来源: https://blog.csdn.net/weixin_45700726/article/details/121451413