Sunday, 3 June 2018

qgis - Can't view PostGIS rasters after changing schemas


I have loaded a few rasters into the Public schema of a PostGIS 2.0 database. Using the db manager in QGIS 1.8.0 I can add the rasters to the map canvas. After moving the rasters to another schema in the same PostGIS database, I am unable to view the rasters in QGIS. However, moving the raster back to the public schema I am again able to view the rasters in QGIS.



  1. Why is this the case? and

  2. is it possible to fix?



I have tried to load the raster directly into another schema using the someschema.sometable syntax in raster2psql but this returns an error stating that my target schema does not exist, however it does exist in the database. Therefore, I have left out the someschema.sometable syntax resulting in the rasters being stored in the public schema and manually moving them to another schema.


EDIT:


Some additional information. When loading a raster to PostGIS a rid and -i column are created. Only after changing the -i column to rast does QGIS recognise the raster layer (layer is still in public schema). However, the QGIS error "not a valid layer" returns after moving the raster table to another schema.


EDIT2:


I have figured out why the raster column heading was named -i. I used the -f parameter without specifying the colummn name. The -I constrained directly followed the -f constrianed therefore resulting in the raster column name being -i.




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...