Engine中如何获取某一点坐标的像素值?

使用IRasterIdentifyObj.MapTip和IRasterIdentifyObj2.GetPropAndValues方法获取的像素值精度不够,与Extract Values to Points工具获取的值有差别,如何提升精度?
已邀请:

朱新颖

赞同来自: jiushidt

【解决办法】:
可以将点的地图坐标转为像素的行列号,然后获取该位置的像素值,这种方法获取的精度高,可以达到预期。
 


IRaster2 raster2 = (IRaster2)RasterLayer.Raster; 
//Get the column and row by giving x,y coordinates in a map space. 
int col = raster2.ToPixelColumn(point.X); 
int row = raster2.ToPixelRow(point.Y); 
//Get the value at a given band. 
double pixelValue = Convert.ToDouble(raster2.GetPixelValue(0, col, row));

要回复问题请先登录注册