How can I create a polygon, containing the actual outlines (aka footprint) of a raster file with PostGIS?
I just need the outlines of the data containing parts of the raster.
ST_PixelAsPolygon creates a complex polygons – but I just need the footprint.
There is a similar question here Creating shapefile showing footprints of Rasters?, but the answers do not cover PostGIS.
Best Answer
Use the ST_Envelope function:
This will return a rectangular bounding box for your raster(s). PostGIS describes what this function returns as: