[postgis-users] Raster database design

David Haynes haynesd2 at gmail.com
Wed Jul 5 18:31:10 PDT 2023


It would make more sense to use a view than another table. If someone
forgets the where f.raster_name check the query time will increase
dramatically.

On Sun, Jul 2, 2023 at 7:40 PM Simon SPDBA Greener <simon at spdba.com.au>
wrote:

> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20230705/4e815a8b/attachment.htm>


More information about the postgis-users mailing list