ST_Rescale — スケール(ピクセルサイズ)だけを調整するリサンプリングを行います。新しいピクセル値のリサンプリングアルゴリズムとして最近傍補間('NearestNeighbor'(米式綴り方))、双線形補間('Bilinear')、3次補完('Cubic')、3次スプライン補完('CubicSpline')、ランツォシュ補完('Lanczos')を用います。デフォルトは最近傍補完です。
raster ST_Rescale(raster rast, double precision scalexy, text algorithm=NearestNeighbour, double precision maxerr=0.125);
raster ST_Rescale(raster rast, double precision scalex, double precision scaley, text algorithm=NearestNeighbour, double precision maxerr=0.125);
スケール(ピクセルサイズ)だけを調整するリサンプリングを行います。新しいピクセル値のリサンプリングアルゴリズムとして最近傍補間('NearestNeighbor'(米式綴り方))、双線形補間('Bilinear')、3次補完('Cubic')、3次スプライン補完('CubicSpline')、ランツォシュ補完('Lanczos')を用います。デフォルトは最も早いですが最も悪い内挿を行う最近傍補完です。
scalexとscaleyで、新しいピクセルサイズを定義します。ラスタを正しい方向にするには、scaleyは負数でなければならないことがしばしばあります。
新しいscalexまたはscaleyがラスタのwidthまたはheightの除数でない時、結果ラスタの範囲は元のラスタの範囲を含むために拡大されます。
maxerrが指定されていない場合には0.125とします。
![]() | |
詳細についてはGDAL Warp resampling methodsをご覧下さい。 |
![]() | |
ST_Rescale is different from ST_SetScale in that ST_SetScale do not resample the raster to match the raster extent. ST_SetScale only changes the metadata (or georeference) of the raster to correct an originally mis-specified scaling. ST_Rescale results in a raster having different width and height computed to fit the geographic extent of the input raster. ST_SetScale do not modify the width, nor the height of the raster. |
初出: 2.0.0 GDAL 1.6.1以上が必要です。
変更: 2.1.0 SRIDなしのラスタで動作するようになりました。
ラスタのピクセルサイズを0.001度から0.0015度にスケール再設定を行う例です。
-- 元のラスタのピクセルサイズ SELECT ST_PixelWidth(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0)) width width ---------- 0.001 -- スケール再設定したラスタのピクセルサイズ SELECT ST_PixelWidth(ST_Rescale(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0015)) width width ---------- 0.0015