名称

ST_SetSkew — 设置地理参考 X 和 Y 偏移(或旋转参数)。如果仅传入一个,则将 X 和 Y 设置为相同的值。

语法

光栅 ST_SetSkew(光栅 rast, float8 skewxy);

光栅 ST_SetSkew(光栅 rast, float8 skewx, float8 skewy);

说明

设置地理参考 X 和 Y 偏移(或旋转参数)。如果仅传入一个,则将 X 和 Y 设置为相同的值。有关更多详细信息,请参阅 World File

示例

-- Example 1
UPDATE dummy_rast SET rast = ST_SetSkew(rast,1,2) WHERE rid = 1;
SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy,
    ST_GeoReference(rast) as georef
FROM dummy_rast WHERE rid = 1;

rid | skewx | skewy |    georef
----+-------+-------+--------------
  1 |     1 |     2 | 2.0000000000
                    : 2.0000000000
                    : 1.0000000000
                    : 3.0000000000
                    : 0.5000000000
                    : 0.5000000000

                
-- Example 2 set both to same number:
UPDATE dummy_rast SET rast = ST_SetSkew(rast,0) WHERE rid = 1;
SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy,
    ST_GeoReference(rast) as georef
FROM dummy_rast WHERE rid = 1;

 rid | skewx | skewy |    georef
-----+-------+-------+--------------
   1 |     0 |     0 | 2.0000000000
                     : 0.0000000000
                     : 0.0000000000
                     : 3.0000000000
                     : 0.5000000000
                     : 0.5000000000
                

另请参阅

ST_GeoReferenceST_SetGeoReferenceST_SkewXST_SkewY