[postgis-users] Raster database design

Simon SPDBA Greener simon at spdba.com.au
Sun Jul 2 16:29:36 PDT 2023


Currently when I load a raster (GDAL) into PostGIS I get a table per 
raster and a row per tile (if tiled).

Is it possible to store multiple rasters within the same table, with a 
descriminator column to identify which rows belong to which raster?

Such storage makes queries like this possible.

SELECT ST_SummaryStats(rast)
   FROM flood as f
WHERE f.raster_name = 'toddriver_2019_3p0m';

Or perhaps a better question: what are the pros/cons of doing so?

create table toddriver_2019_2p5m (
rid integer,
raster_name text,
rast raster );

I would assume that one could not apply the constraints to this table.

regards

Simon

-- 
Simon Greener
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia
(m) +61 418 396 391
(w) www.spdba.com.au
(m) simon at spdba.com.au



More information about the postgis-users mailing list