Tuesday, 23 January 2018

Loading raster from PostGIS DB into QGIS: succeeded yesterday, fails now



I have a PostgreSQL(v.9.2)/Postgis(v.2.0.3) database which includes raster layers (added through raster2pgsql).


To open them in QGIS (v.1.8.0-Lisboa), the "Add Postgis layer" menu will not work; apparently it does not recognize the "raster" type as a geometry.
But I was able (following this little gem of advice) to add the raster layers to the canvas by opening the QGIS DB Manager, right-clicking the layer, and selecting "Add to Canvas". Yesterday, all this worked fine.


Today, when I try this same procedure for the same layers in the same DB, nothing happens, they are not added to the canvas.
If I try to drag them onto the canvas, I get an error message "The layer is not a vaild layer and can not be added to the map".


The layers in the DB have not been changed in any way since yesterday (except perhaps by occasional Vacuuming of the whole DB).

They do have a "rid" and a "rast" attribute, and the latter is filled with long strings (looking similar to geometry values), thus probably still correct, at least not empty.


Dropping (deleting) one of the layers and recreating it from scratch (using exactly the same batch files as before) did not help; they were again flagged as "invalid layers".


I then created raster layers from the same data (and still using the same batch files) in a freshly created new DB, and here it all works again: both right-click > "Add to canvas", or dragging from the DB Manager will add the layer to the QGIS canvas just fine. Let's see for how long.


Is there any chance at all to fix the issue in the older DB?
If so: In which direction would I even have to look to find out what the problem is? DB corruption? QGIS settings? GDAL stuff?


Thanks for any pointers.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...