3

How do you properly use ST_Retile https://postgis.net/docs/RT_Retile.html

there are no directions for it

tried:

update slopes.dem_slope set rast=st_retile(rast,100,100)

and

select st_retile('slopes.dem_slope','rast',100,100) 

and

select st_retile('slopes.dem_slope'::regclass,'rast',100,100) 

all throwing errors

1
  • 2
    The linked page shows that this function wants at least seven parameters.
    – CL.
    Nov 22 '19 at 13:13
1

You must provide all required parameters. Parameter values must have proper type, e.g. setting tile size tw=100 is correct, but tw=100.0 will not work.

CREATE TABLE 
    rasters.global_dem_retiled
AS 
SELECT 
    st_retile(
        'rasters.global_dem', -- source raster table
        'rast',               -- raster column
        ST_SetSRID(ST_Extent(ST_Envelope(rast)), 4326),  
        0.05::float8,         -- pixel size
        0.05::float8, 
        100::int,             -- tile size
        100::int,
        'bilinear' -- Any supported by GDAL algorithm, eg. average, min, max, ...
    ) AS rast 
FROM
    rasters.global_dem
;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.