ST_PixelHeight
更新时间:
复制 MD 格式
Returns the pixel height of a raster object in the spatial reference system.
Prerequisites
The raster object must have a valid spatial reference system identifier (SRID).
Syntax
float8 ST_PixelHeight(raster raster_obj)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object to query. |
Description
The pixel height is the size of a pixel measured in the geometric units of the spatial reference system. The red area in the following figure highlights the pixel height.

In the common case where there is no skew, the pixel height equals the Y scale. When the raster has a non-zero skew, the pixel height differs from the Y scale.
Examples
Rasters with no skew
The following example queries ST_PixelWidth and ST_PixelHeight together. When skew is 0, both values equal their respective scale values.
SELECT st_pixelwidth(rast), st_pixelheight(rast)
FROM raster_table;Expected output:
st_pixelwidth | st_pixelheight
---------------+----------------
60 | 60该文章对您有帮助吗?