ST_Rast2WorldCoord

更新时间:
复制 MD 格式

Converts the pixel coordinates of a raster cell to world coordinates using an affine transformation.

Syntax

point ST_Rast2WorldCoord(raster raster_obj, integer pyramidLevel, integer row, integer column);
geometry ST_Rast2WorldCoord(raster raster_obj, integer pyramidLevel, geometry geom);

The first overload accepts explicit row and column integers and returns a point. The second accepts a geometry in which the x coordinate represents the column number and the y coordinate represents the row number, and returns a geometry.

Parameters

ParameterDescription
raster_objThe raster object.
pyramidLevelThe pyramid level of the raster.
rowThe row number of the cell.
columnThe column number of the cell.
geomThe geometry to convert. The x coordinate represents the column number in the raster and the y coordinate represents the row number.

Usage notes

  • The raster object must have a valid spatial reference system identifier (SRID). If no SRID is set, the function cannot perform the coordinate transformation.

Example

SELECT ST_Rast2WorldCoord(raster_obj, 0, 0, 0) FROM raster_table;