名稱

ST_Reskew — 透過僅調整網格的傾斜(或旋轉參數)來重新取樣網格。新的像素值會使用 NearestNeighbor (美式或英式拼寫)、Bilinear、Cubic、CubicSpline 或 Lanczos 重新取樣演算法計算。預設值為 NearestNeighbor。

概要

raster ST_Reskew(raster rast, double precision skewxy, text algorithm=NearestNeighbor, double precision maxerr=0.125);

raster ST_Reskew(raster rast, double precision skewx, double precision skewy, text algorithm=NearestNeighbor, double precision maxerr=0.125);

描述

透過僅調整網格的傾斜(或旋轉參數)來重新取樣網格。新的像素值會使用 NearestNeighbor (美式或英式拼寫)、Bilinear、Cubic、CubicSpline 或 Lanczos 重新取樣演算法計算。預設值為 NearestNeighbor,它是最快的但會產生最差的內插結果。

skewxskewy 定義新的傾斜。

新網格的範圍將涵蓋所提供網格的範圍。

如果未指定 maxerr,則 maxerror 百分比為 0.125。

[Note]

請參閱:GDAL Warp 重新取樣方法以了解更多詳細資訊。

[Note]

ST_Reskew 與 ST_SetSkew 的不同之處在於,ST_SetSkew 不會重新取樣網格以符合網格範圍。ST_SetSkew 僅變更網格的元數據(或地理參考)以更正原始錯誤指定的傾斜。ST_Reskew 會產生一個具有不同寬度和高度的網格,該網格計算結果會符合輸入網格的地理範圍。ST_SetSkew 不會修改網格的寬度或高度。

可用性:2.0.0 需要 GDAL 1.6.1+

已變更:2.1.0 可用於沒有 SRID 的網格

範例

一個簡單的範例,將網格的傾斜從 0.0 重新傾斜至 0.0015。

-- the original raster non-rotated
SELECT ST_Rotation(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0));

-- result
0

-- the reskewed raster raster rotation
SELECT ST_Rotation(ST_Reskew(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0015));

-- result
-0.982793723247329