6

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?

2
  • It didn't work either with ERDAS IMG converted from the original .tif file through GDAL_TRANSLATE command.
    – alextc
    Commented Mar 22, 2013 at 3:27
  • 1
    Did you use "Add PostGIS raster layer" selection, that other one works only with vectors ("Add Postgis layer") Commented Mar 22, 2013 at 13:45

1 Answer 1

11

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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