We have a satellite image loaded into PostGIS. We've calculated a reflectance raster from that image and stored the results as 32BF pixels. There are 54 1000x1000 tiles in the reflectance raster.
I want to create a GeoTIFF of that reflectance raster. Individual tiles work fine. But using an ST_Union on the reflectance raster column raises an exception when executing the query below from Python:
SELECT ST_AsTIFF(ST_Union(refl_rast), 'GTiff') gtiff FROM sat_rast_calc InternalError: invalid memory alloc request size 1344128795
I know I can export the tiles individually and merge them with gdal_merge.py afterwards. I'd prefer to export this GTiff in one step though.
Would any of these be likely to help?
- Using a different pixel type
- Passing in another ST_AsGTIFF option
- Increasing a PostGRES memory parameter
- Increasing a Linux kernel parameter
- Doing something else