| 标注 | 说明 | 数据类型 | 
输入栅格  | 要查询的栅格。  | Mosaic Dataset; Mosaic Layer; Raster Layer | 
位置  | 像素位置的 x 和 y 坐标。  | Point | 
波段 (可选)  | 指定要查询的波段。留空以查询多波段数据集中的所有波段。  | Value Table | 
派生输出
| 标注 | 说明 | 数据类型 | 
| 像素值 | 像素值。  | 字符串 | 
使用 x,y 坐标获取给定像素的值。
| 标注 | 说明 | 数据类型 | 
输入栅格  | 要查询的栅格。  | Mosaic Dataset; Mosaic Layer; Raster Layer | 
位置  | 像素位置的 x 和 y 坐标。  | Point | 
波段 (可选)  | 指定要查询的波段。留空以查询多波段数据集中的所有波段。  | Value Table | 
| 标注 | 说明 | 数据类型 | 
| 像素值 | 像素值。  | 字符串 | 
arcpy.management.GetCellValue(in_raster, location_point, {band_index})| 名称 | 说明 | 数据类型 | 
in_raster  | 要查询的栅格。  | Mosaic Dataset; Mosaic Layer; Raster Layer | 
location_point  | 像素位置的 x 和 y 坐标。  | Point | 
band_index [band_index,...] (可选)  | 指定要查询的波段。留空以查询多波段数据集中的所有波段。  | Value Table | 
| 名称 | 说明 | 数据类型 | 
| out_string | 像素值。  | 字符串 | 
这是 GetCellValue 工具的 Python 示例。
import arcpy
result = arcpy.management.GetCellValue("C:/data/rgb.img", "480785 3807335", "2;3")
cellvalue = int(result.getOutput(0))
print(cellvalue)这是 GetCellValue 工具的 Python 脚本示例。
#====================================
# Get Cell Value
   
import arcpy
arcpy.env.workspace = "C:/Workspace"
# Get the Band_2 and Band_3 cell value of certain point in a RGB image
result = arcpy.management.GetCellValue("rgb.img", "480785 3807335", "2;3")
cellvalue = int(result.getOutput(0))
# View the result in execution log
print(cellvalue)