ST_SetGeoreference

更新时间:
复制 MD 格式

Sets the georeference of a raster object by specifying its spatial reference system and affine transformation parameters.

Syntax

raster ST_SetGeoreference(raster rast, integer srid, integer aop, double A, double B, double C, double D, double E, double F)

Parameters

ParameterDescription
rastThe raster object.
sridThe spatial reference system identifier (SRID) of the raster object.
aopThe spatial reference point. Valid values: 1 (center cell), 2 (upper-left cell).
A, B, C, D, E, FThe six parameters of an affine transformation. The transformation maps pixel coordinates to geographic coordinates as follows: x = A × Column number + B × Row number + C; y = D × Column number + E × Row number + F

Usage notes

If the raster object is stored in external mode, it must already be geographically referenced and the specified SRID must exist in the spatial_ref_sys table. If either condition is not met, the update fails.

Examples

update rast set rast=ST_SetGeoreference(rast,4326,1,8.4163,0,124,0,-8.4163,36.2) where id=1;

Output:

(1 row)