[Qgis-user] PyQGIS to add PostGIS raster layer?

Thayer Young thayeray at yahoo.com
Thu Apr 30 07:10:54 PDT 2020


Is it possible to add a PostGIS raster layer to a project using PyQGIS? 
The PyQGIS Developer Cookbook mentions adding rasters from files, geopackages and WCS services. 
If I try using a QgsDataSourceUri by feeding it a raster column instead of a geometry column, the PostGIS error that is generated shows that is not going to work because raster is not a geometry: 
  
WARNING    Erroneous query: SELECT 0, array_agg(DISTINCT st_srid("rast")::text || ':' || UPPER(geometrytype("rast"))) FROM "public"."indicators__g_economic_rebal_r_62ft" returned 7 [ERROR: function geometrytype(raster) does not exist 

Any ideas of what I can do? Is the best course of action to make it into a webservice  first using QGIS Server or Geoserver? 
-Thayer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200430/704ee758/attachment.html>


More information about the Qgis-user mailing list