ST_World2RastCoord

更新时间:
复制 MD 格式

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

ParameterDescription
raster_objThe raster object. Must have a valid spatial reference system identifier (SRID).
pyramidLevelThe pyramid level.
coordThe world coordinates of the cell.
geomThe 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;