I have a raster table (pre-created using CREATE TABLE) containing multiple individual raster files that I append piece by piece to a final table. The table itself is in its own tablespace 'gisdir' and schema 'gisdata'.
This is done with the following command:

raster2pgsql -s 32615 -F -M fileX.tif -t 100x100 -T gisdir -X gisdir -a gisdata.map > query.sql

This query is run multiple times and with different SRIDs and filenames. So the table gisdata.map finally should contain multiple raster files of the same format which all have different extents, SRIDs and names. This is also the reason, why I failed to provide constraints in the query.
Now I want to be able to query for instance the raster with the name fileX.tif in a query (in QGIS), but it fails. Probably because it was not probably registered as raster.

How can I do this given that the AddRasterContraints command requires single SRID to be specified? Or is this even impossible (storing many raster files with different SRIDs and extents in a single table)?

  • I believe it is possible via the raster_column parameter. You can definitely have multiple rasters in a table. What do you see in select * from raster_columns? – John Powell Oct 26 '14 at 14:21
  • Nothing with regards to the gisdata.map file yet. I was in the understanding that this table is updated if the RasterConstraints are called/set. Do you have a working example how to load/setup such a raster table? – Curlew Oct 26 '14 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.