ST_CellDepth
更新时间:
复制 MD 格式
Returns the pixel depth of a raster object as an integer. Pixel depth defines how many bits are used to store each cell value, which determines the range of values the raster can represent.
Syntax
integer ST_CellDepth(raster raster_obj);Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object. |
Return values
Returns an integer representing the pixel depth. Valid values:
| Return value | Bits per cell | Typical use |
|---|---|---|
| 0 | Unknown | Pixel depth could not be determined |
| 1 | 1-bit | Binary masks |
| 2 | 2-bit | Classification with up to 4 categories |
| 4 | 4-bit | Classification with up to 16 categories |
| 8 | 8-bit | Grayscale imagery, optical band data |
| 16 | 16-bit | Digital elevation models (DEM), high-precision imagery |
| 32 | 32-bit | Floating-point meteorological or scientific data |
| 64 | 64-bit | Double-precision scientific raster data |
Examples
Query the pixel depth of each raster object in raster_table:
SELECT ST_CellDepth(raster_obj) FROM raster_table;Output:
8该文章对您有帮助吗?