0

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.

1
  • 1
    If the GeoTIFF file loads in QGIS, isn't this sufficient? What are you hoping to benefit from loading a raster into a database? It won't be any faster. – Mike T Nov 9 '14 at 20:53
1

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

0

the geometry column is for vector data, there is no geometry asociated with raster.

You need a QGIS plugin to display PostGIS raster (see here). The plugin can be used for loading and for visualization.

0
0

Have you tried to add the PostGIS raster layer with the table manager (https://plugins.qgis.org/plugins/tablemanager/) ? I experienced similar problems: be sure to have the connection to PostGIS correctly configured (for example, I think 'user' is mandatory).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.