[GIS] Import DEM into PostGIS for QGIS

dempostgisqgisraster2pgsql

I'm a complete GIS newbie so sorry if I'm using the wrong terminology in searching for a solution to this… I'm trying to import a DEM into PostGIS and display it in QGIS. The data is from the EU-DEM and I imported into PostGIS with:

raster2pgsql -s 3035 -t 200x200 -I -d "$TIF_FILE" public.eudem | psql -d postgis

When I try to add this table to QGIS (Add PostGIS Layers…) it seems to have no geometry associated with it.

The GeoTIFF file itself loads directly into QGIS fine, is georeferenced fine, and the CRS is detected correctly etc. PostGIS is set up correctly and connecting to QGIS correctly and I have vector data from shapefiles in it showing in QGIS successfully (and showing overlaid onto the raster DEM loaded when directly into QGIS). But I want to move the raster data into PostGIS. What am I missing? Thanks!

Edit: sorry should have mentioned versions: QGIS 2.2.0-Valmiera, compiled with GDAL 1.11.0, and PostGIS 2.1.2 on Postgres 9.3.4, all built from source using homebrew on OS X.

Best Answer

To load the imported PostGIS raster into QGIS:

First, you need to create a connection to your PostGIS database containing the raster.

Then, You can go to Database -> DB Manager -> DB Manager from the system menu.

The DB Manager Dialog Box will show. You can expand your database; browse to the raster and right-click on it. Choose "Add to Canvas". This works with QGIS 2.6 and 2.4 (I don't have 2.2 to test with).

Hope this helps.

enter image description here