0

The raster from PostGIS is loading very slowly.

  1. I added pyramids. gdaladdo d:\res\t1.tif -r lanczos -ro 2 4 8 16 32 64
  2. Converted to the "cloud optimized GeoTIFF" format. gdal_translate d:\res\t1.tif d:\res\OGC_t1.tif -co TILED=YES -co COPY_SRC_OVERVIEWS=YES -co COMPRESS=LZW.
  3. Added to PostGIS as out-db. raster2pgsql -s 4326 -C -I -F d:\res\OGC_t1 -R| psql

When I open a table in QGIS, it loads very slowly. Pyramids are not used.

If you load the table from a file, then the pyramids are located and the loading is fast. What am I doing wrong?

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Nov 10, 2022 at 11:41

1 Answer 1

0

You can create spatial index on the raster table in PostGIS, and that can speed up the performance for the raster.

CREATE INDEX idx_name ON raster_table_name USING GIST(ST_Envelope(raster_column));

This can impact the loading of raster much faster from the default raster table.

You can also follow some approaches here

https://gis.stackexchange.com/a/416332/51710

answered Nov 10, 2022 at 11:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.