Skip to main content

栅格波段属性

汇总

Describe 函数可返回栅格波段的以下属性。 还支持 数据集 属性组。

对于栅格波段, Describe dataType 属性将返回 "RasterBand" 的值。

属性

属性 说明 数据类型

height

(只读)

行数。

Integer

isInteger

(只读)

表明栅格波段是否具有整型。

Boolean

meanCellHeight

(只读)

y 方向上的像元大小。

Double

meanCellWidth

(只读)

x 方向上的像元大小。

Double

noDataValue

(只读)

栅格波段的 NoData 值。

String

pixelType

(只读)

像素类型。

  • U1—1 位

  • U2—2 位

  • U4—4 位

  • U8—8 位无符号整型

  • S8—8 位整型

  • U16—16 位无符号整型

  • S16—16 位整型

  • U32—32 位无符号整型

  • S32—32 位整型

  • F32—单精度浮点型

  • F64—双精度浮点型

String

primaryField

(只读)

字段的索引。

Integer

tableType

(只读)

表的类名称。

  • Value—表中的值仅用作值,而不用于索引。

  • Index—表中的值用作栅格表中的索引。

  • Invalid—值无效。

String

width

(只读)

列数。

Integer

代码示例

栅格波段属性示例

以下独立脚本显示栅格波段的一些属性:

import arcpy

# Create a Describe object from the raster band
desc = arcpy.Describe("C:/data/preston.img/Band_1")

# Print some raster band properties
print("Height: %d" % desc.height)
print("Width:  %d" % desc.width)
print("Integer Raster: %s" % desc.isInteger)