5

I am wondering if there is an optimum raster tile size when using -t in raster2pgsql. I am setting -t auto and it creates thousands of tiles and takes hours to load.

I am working with very large rasters with 1m resolution.

I know that there is a limit of ~55,000 rows X ~55,000 columns. Should this be my tile size? Does auto produce a raster that will be processed the fastest in subsequent analysis using, e.g., map algebra?

1
  • 1
    Optimum in which respect? I did some benchmarking with various tile sizes and a standard process I was doing with the raster, and found that the default value (chosen by "-t auto") was extremely slow, and the value I selected (160x128) was not in the range of 32x32 to 100x100. Tile sizes larger than 512x512 resulted in much longer times than the tiny default. I'm afraid you're going to need to do your own benchmark.
    – Vince
    Oct 31, 2018 at 18:22

1 Answer 1

3

Based on the textbook Mastering PostGIS

Updated answer based on @Vince comment below. It appears if you choose something in the range of 32x32 and 100x100 would be optimal. As it is the default setting and I would surmise that is also optimal raster tile size when using -t in raster2pgsql.

enter image description here

4
  • 1
    I don't think the documentation you referenced means that 32x100 is the default setting. Instead it means it chooses something in the range of 32x32 and 100x100.
    – Vince
    Oct 31, 2018 at 18:18
  • @Vince, thanks I believe you are correct. I've updated my post.
    – whyzar
    Oct 31, 2018 at 18:38
  • I think behaviour has now changed: if you don't specify -t it leaves it as-is. In my case creating 5000x5000 rasters.
    – OrangeDog
    May 19, 2021 at 12:33
  • And with -t auto it chooses 250x250.
    – OrangeDog
    May 19, 2021 at 14:04

Your Answer

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

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