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));
1 个回复
朱新颖
赞同来自: jiushidt
可以将点的地图坐标转为像素的行列号,然后获取该位置的像素值,这种方法获取的精度高,可以达到预期。
要回复问题请先登录或注册