ST_Resample — 指定したリサンプリングアルゴリズム、新しいピクセル範囲、グリッドの隅、定義するか他のラスタから借りてきた地理参照属性を使ってリサンプリングを行います。
raster ST_Resample(raster rast, integer width, integer height, double precision gridx=NULL, double precision gridy=NULL, double precision skewx=0, double precision skewy=0, text algorithm=NearestNeighbor, double precision maxerr=0.125);
raster ST_Resample(raster rast, double precision scalex=0, double precision scaley=0, double precision gridx=NULL, double precision gridy=NULL, double precision skewx=0, double precision skewy=0, text algorithm=NearestNeighbor, double precision maxerr=0.125);
raster ST_Resample(raster rast, raster ref, text algorithm=NearestNeighbor, double precision maxerr=0.125, boolean usescale=true);
raster ST_Resample(raster rast, raster ref, boolean usescale, text algorithm=NearestNeighbor, double precision maxerr=0.125);
指定したリサンプリングアルゴリズム、新しいピクセル範囲 (width & height)、グリッド隅 (gridx & gridy)、定義するか他のラスタから借りてきた地理参照属性 (scalex, scaley, skewx, skewy)を使ってリサンプリングを行います。参照ラスタを使用する場合には、二つのラスタは同じSRIDでなければなりません。
新しいピクセル値は次のリサンプリングアルゴリズムの一つを使って計算されます:
NearestNeighbor (最近傍補間、英語又は米式綴り方)
Bilinear (双線形補間)
Cubic (3次補完)
CubicSpline (3次スプライン補完)
Lanczos (ランチョス補間)
Max (最大)
Min (最小)
デフォルトはNearestNeighbor (最近傍補間)です。最も実行速度が速いですが、結果の補間が最も悪くなります。
maxerrが指定されていない場合には0.125とします。
![]() | |
詳細については GDAL Warp resampling methodsをご覧下さい。 |
Availability: 2.0.0 GDAL 1.6.1以上が必要です。
Enhanced: 3.4.0 リサンプリング選択肢に最大と最小を追加
SELECT
ST_Width(orig) AS orig_width,
ST_Width(reduce_100) AS new_width
FROM (
SELECT
rast AS orig,
ST_Resample(rast,100,100) AS reduce_100
FROM aerials.boston
WHERE ST_Intersects(rast,
ST_Transform(
ST_MakeEnvelope(-71.128, 42.2392,-71.1277, 42.2397, 4326),26986)
)
LIMIT 1
) AS foo;
orig_width | new_width
------------+-------------
200 | 100