Opened 3 years ago

Last modified 10 months ago

#3920 new defect

[raster] _add_raster_constraint_coverage_tile and memory issue with large tile coverage

Reported by: mloskot Owned by: Bborie Park
Priority: medium Milestone: PostGIS 3.1.0
Component: raster Version: 2.3.x
Keywords: tile coverage Cc:


TL:TR: Export of large raster (eg. 230K x 210K pixel) as tile coverage with regular blocking fails during addition of constraints due to invalid memory alloc request size 1932000000 (XX000)

The _add_raster_constraint_coverage_tile function blank raster with rasterised whole spatial extent of the tile coverage, that is a raster with dimensions of the whole coverage. That blank raster is used as RHS operand in ST_IsCoverageTile.

The _add_raster_constraint_coverage_tile function sequence is ST_AsRaster followed by bands & data removal with ST_MakeEmptyRaster.

The problem is, AFAIU, that ST_AsRaster already requires allocation of a huge raster for the whole tile coverage, that obviously fails. The following bands clean-up is really a cosmetic optimisation after the fact.

Perhaps, a feasible solution would be to have internal ST_AsRaster that already creates a dummy band-less raster without attempt to allocate memory for data.

Change History (3)

comment:1 Changed 3 years ago by robe

Milestone: PostGIS 2.5.0

comment:2 Changed 2 years ago by robe

Milestone: PostGIS 2.5.0PostGIS 3.0.0

comment:3 Changed 10 months ago by robe

Milestone: PostGIS 3.0.0PostGIS 3.1.0
Note: See TracTickets for help on using tickets.