12

I have imported a raster tif image into PostgreSQL with this command:

raster2pgsql -s 32643 -I -M filepath.tif -F -t 100x100 public.databassename > filepath.sql

And imported the output SQL file inside the PostgreSQL database running this:

psql -U postgres -d databasename -f filepath.sql

After connecting to this database in QGIS, I am not able to visualise the tif image due to missing geometry content. Please help me out to visualise the tif raster imagery in QGIS.

0

1 Answer 1

25

In QGIS 2.6.1, 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.

From your description of the problem, you are using the regular "Add PostGIS Layers", which will not show your raster table, since it is for vectors and alphanumeric tables.

1
  • What about Leaflet ? Do you know a way to add postgres rasters to Leaflet Map ?
    – Capan
    Commented Jul 15, 2018 at 9:04

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.