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
| Parameter | Description |
|---|---|
raster_obj | The raster object. |
pyramidLevel | The pyramid level of the raster. |
row | The row number of the cell. |
column | The column number of the cell. |
geom | The 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;该文章对您有帮助吗?