[GIS] QGIS cannot view raster loaded to PostGIS through raster2pgsql

postgispostgresqlqgisraster

I tried to load a raster GeoTIFF image to a PostGIS database using "raster2pgsql" following the OpenGeo Suite Manual. The command I used is:

C:\>raster2pgsql -s 4283 -I -C -M "C:\Program Files\GeoServer 2.2.5\data_dir\data\gcur\interp_clipped.tif" -F public.myraster | psql -d MyPostGISDB -h localhost -p 5432 -U postgres

The table was successfully created and found in "pgAdmin III" but not accessible through QGIS. When I tried to load PostGIS layers in QGIS, it only showed "raster_columns" and not the "myraster" table. In the PostGIS Manager window in QGIS, this table is marked as plain table and with "No Geometry".

Can anyone give me some hints about it?

Best Answer

Do not use the regular "Add PostGIS Layers", it will not show your raster table. The plugin "Load Postgis Raster to QGIS" was not updated to QGIS v.2.0, so it won't work either.

In QGIS v.2.6 go to menu Database->DB Manager->DB Manager, set the database connection and you will see the raster table. You can drag and drop it or right click and select Add to canvas.

Note: There was a bug on loading PostGIS raster layers to QGIS, which was solved in v.2.6: http://hub.qgis.org/issues/8628 So, update your QGIS to v. >= 2.6