Opened 3 weeks ago

Last modified 3 weeks ago

#3920 new defect

[raster] _add_raster_constraint_coverage_tile and memory issue with large tile coverage

Reported by: mloskot Owned by: dustymugs
Priority: medium Milestone: PostGIS 2.5.0
Component: raster Version: 2.3.x
Keywords: tile coverage Cc:

Description

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 (1)

comment:1 Changed 3 weeks ago by robe

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