Computes the pixel coordinates of a raster cell from its world coordinates and pyramid level, using an inverse affine transformation.
Syntax
point ST_World2RastCoord(raster raster_obj, integer pyramidLevel, point coord);
geometry ST_World2RastCoord(raster raster_obj, integer pyramidLevel, geometry geom);Parameters
| Parameter | Description |
|---|---|
| raster_obj | The raster object. Must have a valid spatial reference system identifier (SRID). |
| pyramidLevel | The pyramid level. |
| coord | The world coordinates of the cell. |
| geom | The geometry to convert. |
Return value
Returns a point when the input is a point coord, or a geometry when the input is a geometry geom. In the returned value, the x coordinate is the column number and the y coordinate is the row number in the raster.
Example
SELECT ST_World2RastCoord(raster_obj, 0, '(27.9,128.6)') FROM raster_table;该文章对您有帮助吗?