名前

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=NearestNeighbour, 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=NearestNeighbour, double precision maxerr=0.125, boolean usescale=true);

raster ST_Resample(raster rast, raster ref, boolean usescale, text algorithm=NearestNeighbour, double precision maxerr=0.125);

説明

指定したリサンプリングアルゴリズム、新しいピクセル範囲(width & height)、グリッドコーナー(gridx & gridy)、定義するか他のラスタから借りてきた地理参照属性(scalex, scaley, skewx, skewy)を使ってリサンプリングを行います。参照ラスタを使用する場合には、ふたつのラスタは同じSRIDでなければなりません。

新しいピクセル値は、リサンプリングアルゴリズムとして最近傍補間('NearestNeighbor'(米式綴り方))、双線形補間('Bilinear')、3次補完('Cubic')、3次スプライン補完('CubicSpline')、ランツォシュ補完('Lanczos')を用います。デフォルトは最も早いですが最も悪い内挿を行う最近傍補完です。

maxerrが指定されていない場合には0.125とします。

[注記]

詳細についてはGDAL Warp resampling methodsをご覧下さい。

初出: 2.0.0 GDAL 1.6.1以上が必要です。

変更: 2.1.0 srid引数を削除しました。参照ラスタを使う形式では、もはや参照ラスタのSRIDを適用しません。ラスタの投影変換にはST_Transform()を使います。SRIDなしで動作します。

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                                
                                

関連情報

ST_Rescale, ST_Transform