4

I have successfully added a raster to postgis using the following:

raster2pgsql -s 4326 -I -C -M 00N_030E.tif -F -t 250x250 -a test.00N_030E | psql -U postgres -d raster -h localhost -p 5432

I tried loading the raster into QGIS 2.14.1 to view it. However, it is listed as a table without a geometry.

This is from the QGIS message log: 2016-05-09T12:35:34 1 Field rast ignored, because of unsupported type raster

I have tried to enable all raster drivers using the following:

ALTER DATABASE raster SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';

and

ALTER SYSTEM SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';

but did not seems to work.

Any suggestions as to what the issue maybe and how to rectify it?

1
  • I am seeing the same, importing a GTiff. enabled all the drivers, though one would think GTiff should be enough in PostGIS 10.3 and QGIS3 producing the same message. WARNING Field rast ignored, because of unsupported type raster Was there a resolution to this issue? Commented Jun 2, 2018 at 2:13

1 Answer 1

1

Your best bet is to add the raster using the DB Manager (Database > DB Manager > DB Manager). This will let you preview your imported raster tables, and you can add them to the canvas using right-click and choose 'add to canvas' from the context menu (tested in 2.14.2)

Doing the same thing from QGIS Browser or the Add PostGIS Layers tool button don't work, which is a bit confusing.

2
  • I am able to add the table to QGIS but it does not render the raster. Also, there is an attribute column, which I'm not sure should be available for rasters. In essence it seems if QGIS is reading the postgis raster as a vector file. In the DB Manager the preview tab is not available/can't click it. In the browser the preview tab is active but does not render a preview.
    – PyMapr
    Commented May 9, 2016 at 12:36
  • The table created with raster2pgsql contains a couple of text fields, and a BLOB for the raster. So don't worry about the inclusion of text fields. I tried it and it worked fine on a raster I'd imported in PostgreSQL a few months ago. Things might have changed, though. I see the same thing as you if I try to use QGIS Browser.. it looks like a CSV import, with no raster column. And 'add postgresql layer' doesn't recognise the raster BLOB format either.
    – Steven Kay
    Commented May 9, 2016 at 20:48

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.