Name

ST_Resample — Resample um raster usando um algorítimo específico, novas dimensões, um canto aleatório da grade e um conjunto de rasters georreferenciando atributos definidos ou emprestados de outro raster.

Synopsis

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);

Descrição

Resample um raster usando um algorítimo específico, novas dimensões (largura & altura), um canto de grade (gradex & gradey) e um conjunto de rasters georreferenciando atributos (scalex, scaley, skewx & skewy) definidos ou emprestados de outro raster. Se estiver utilizando uma referência raster, os dois rasters devem possuir o mesmo SRID.

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.

Uma porcentagem maxerror de 0.125 é usada se nenhum maxerr for especificado.

[Note]

Recorra a: GDAL Warp resampling methods para mais detalhes.

Disponibilidade: 2.0.0 Requer GDAL 1.6.1+

Enhanced: 3.4.0 max and min resampling options added

Exemplos

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