[QGIS-Developer] PostGIS out-of-db raster rendering as a black box in QGIS

Jakob Lanstorp jlanstorp at gmail.com
Thu May 17 07:40:13 PDT 2018


I load a geotiff with raster2pgsql with the -R param for having an out of db
stored raster in PostGIS.
The raster renders in QGIS through the DB Manager as a black box with no
values. Running a raster layer statistics in QGIS returns 0 for all values.
I have tried loading the raster as a in-db raster and this works fine
rendering in QGIS.

Out-db is enabled:
SET postgis.enable_outdb_rasters TO True;
SHOW postgis.enable_outdb_rasters;

ST_SummaryStats in PostGIS returns the same for both in- and out-of-db
raster.

The out-db raster is registered correct in PostGIS:

SELECT r_table_name, r_raster_column, out_db FROM raster_columns;
returning: sa_out, rast, {true,true,true,true}

Since raster2pgsql uses GDAL I suspect GDAL within QGIS is able to read the
raster to QGIS.

The sample tif is available for download here: 
3320D_2010_315_RGB_LATLNG.TIF
<http://lanstorp.com/files/3320D_2010_315_RGB_LATLNG.TIF>  

It is loaded into PostGIS with:
raster2pgsql -C -R -F -Y -I
C:\map\raster2pg\tif\3320D_2010_315_RGB_LATLNG.TIF myschema.sa_out | psql -U
postgres -d sandbox localhost -p 5432

Is this a GDAL or QGIS problem? Any solution? Anyone able to render an
out-of-db raster from PostGIS?

Jakob




-----
Jakob Lanstorp
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html


More information about the QGIS-Developer mailing list