Name

ST_Rescale — Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline, Lanczos, Max or Min resampling algorithm. Default is NearestNeighbor.

Synopsis

raster ST_Rescale(raster rast, double precision scalexy, text algorithm=NearestNeighbor, double precision maxerr=0.125);

raster ST_Rescale(raster rast, double precision scalex, double precision scaley, text algorithm=NearestNeighbor, double precision maxerr=0.125);

설명

Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using one of the following resampling algorithms:

  • NearestNeighbor (english or american spelling)

  • Bilinear

  • Cubic

  • CubicSpline

  • Lanczos

  • Max

  • Min

The default is NearestNeighbor which is the fastest but results in the worst interpolation.

scalex and scaley define the new pixel size. scaley must often be negative to get well oriented raster.

새 scalex 또는 scaley가 래스터 너비 또는 높이의 나눗수가 아닌 경우, 결과 래스터의 범위가 입력 래스터의 범위를 포괄하도록 확장됩니다. 입력 범위를 정확히 유지하고자 할 경우, ST_Resize 를 참조하십시오.

maxerr is the threshold for transformation approximation by the resampling algorithm (in pixel units). A default of 0.125 is used if no maxerr is specified, which is the same value used in GDAL gdalwarp utility. If set to zero, no approximation takes place.

[Note]

자세한 내용은 GDAL Warp resampling methods 를 참조하십시오.

[Note]

ST_Rescale은 래스터 범위에 매칭시키기 위해 래스터를 리샘플링한다는 점에서 ST_SetScale 과는 다릅니다. ST_SetScale은 원본에서 잘못 설정된 축척을 교정하기 위해 래스터의 메타데이터(또는 지리참조)를 변경할 뿐입니다. ST_Rescale 함수는 입력 데이터의 지리적 범위에 맞추기 위해 너비와 높이를 수정한 래스터를 출력합니다. ST_SetScale 함수는 래스터의 너비는 물론 높이도 수정하지 않습니다.

2.0.0 버전부터 사용할 수 있습니다. GDAL 1.6.1 이상 버전이 필요합니다.

Enhanced: 3.4.0 max and min resampling options added

변경 사항: 2.1.0 버전부터 SRID가 없는 래스터도 입력받습니다.

예시

픽셀 크기 0.001도에서 픽셀 크기 0.0015도로 래스터를 재축척하는 단순한 예시입니다.

-- the original raster pixel size
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

-- the rescaled raster raster pixel size
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

참고

ST_Resize, ST_Resample, ST_SetScale, ST_ScaleX, ST_ScaleY, ST_Transform