Bug report #8628

DB Manager does not load PostGIS rasters using QGIS-master for Debian

Added by Mathieu Basille over 10 years ago. Updated about 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:DB Manager
Affected QGIS version:master Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied:No Resolution:worksforme
Crashes QGIS or corrupts data:No Copied to github as #:17362

Description

I'm currently using the nightly repository for Debian (https://issues.qgis.org/projects/quantum-gis/wiki/Download#213-Master) under Debian Testing (Jessie). Right now, the package version installed is:

If I open the DB Manager (v. 0.1.20), connect to a PostGIS data base, I'm not able to load a raster, either by drag and drop to the list of layers, or by left-clicking and 'Add to canvas'. All my rasters are tiled. Loading vector layers work with both approaches.

However, I remember that loading PostGIS rasters used to work couple of weeks ago... I'm not a heavy QGIS user, so that I cannot confirm whether an update occurred since then, I just noticed recently that it didn't work any more. I'd be happy to provide any additional information required.

Version of GDAL :

libgdal1 *** 1.9.0-3.1+b2 0
900 http://ftp.us.debian.org/debian/ jessie/main amd64 Packages

libgdal1-dev: *** 1.9.0-3.1 0
900 http://ftp.us.debian.org/debian/ jessie/main amd64 Packages

gdal-bin *** 1.9.0-3.1+b2 0
900 http://ftp.us.debian.org/debian/ jessie/main amd64 Packages

Mathieu.

qgis_error.png - Error-Window (34.1 KB) Ruediger Brand, 2015-07-08 12:32 AM

qgis_error1.png - details error (42.3 KB) Ruediger Brand, 2015-07-08 12:33 AM


Related issues

Duplicated by QGIS Application - Bug report #8765: Postgis raster shows random data with out-db image data Closed 2013-10-03

History

#1 Updated by Mathieu Basille over 10 years ago

I forgot to say: if I drag and drop a raster layer, or if I use the 'Add to canvas' option, nothing happens. No crash, no loading, really nothing (and the system does not seem busy).

#2 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Feedback

please update to qgis 2.0.1 or master, try again and report back.

#3 Updated by Mathieu Basille over 10 years ago

About GDAL, here is what QGIS says in the about window:

Compiled with GDAL/OGR 1.9.0 Used with GDAL/OGR 2.0dev

#4 Updated by Mathieu Basille over 10 years ago

Giovanni Manghi wrote:

please update to qgis 2.0.1 or master, try again and report back.

Well, as far as I can tell, I'm on the master: that's at least the most recent version available on the Debian repository (see http://qgis.org/debian-nightly/dists/sid/main/binary-amd64/Packages).

#5 Updated by Giovanni Manghi over 10 years ago

master is now tagged 2.1

#6 Updated by Mathieu Basille over 10 years ago

Giovanni Manghi wrote:

master is now tagged 2.1

But that's not the one available in the official QGIS repository for Debian. Or am I missing something?

#7 Updated by Mathieu Basille over 10 years ago

Sorry to insist on this, but is there anything I can do using the QGIS official repository for Debian?
Thanks.

#8 Updated by Mathieu Basille over 10 years ago

With today's update, the QGIS official repository for Debian switched to 2.1.0-Master:

qgis: *** 2.1.0+git20130925+bb63eb1~unstable1 0
904 http://qgis.org/debian-nightly/ sid/main amd64 Packages

However, my problem is still here: I can load vectors (points, lines, polygons), but not rasters from the DB Manager.

#9 Updated by Mathieu Basille over 10 years ago

The problem is still here with today's update (if anyone's interested):

qgis: *** 2.1.0+git20130930+52ac084~unstable1 0
904 http://qgis.org/debian-nightly/ sid/main amd64 Packages

#10 Updated by Paolo Cavallini about 10 years ago

I can show rasters, except for those registered out-of-db (-R)

#11 Updated by Paolo Cavallini about 10 years ago

Further info: loaded rasters can in general be loaded, whereas those resulting from in-db elaborations (e.g., aspect from DTM) cannot. Right clicking does not do anything, whereas drag & drop on the canvas says:

GDAL provider: Cannot get GDAL raster band:
Raster layer: Provider is not valid (provider: gdal, URI: [etc]

DB Manager complains there is no PK, even though rid is present; however, adding a PK does not solve the problem

#12 Updated by Paolo Cavallini about 10 years ago

  • Priority changed from Normal to High

#13 Updated by Giovanni Manghi about 10 years ago

  • Priority changed from High to Normal

There is no crash or data corruption, so I'm lowering the priority.

#14 Updated by Paolo Cavallini over 9 years ago

Confirmed on 2.4

#15 Updated by Paolo Cavallini over 9 years ago

Now it seems to work, except for -r (out of db) rasters, that crash QGIS

#16 Updated by Paolo Cavallini about 9 years ago

Apparently still valid: the result of st_resample cannot be read.

CREATE TABLE dtm1k
AS SELECT rid, ST_Resample(rast,1000,1000)
AS rast
FROM dtm_single;

#17 Updated by Sandro Santilli almost 9 years ago

Should have been fixed with 27f1d9fb3ebb2445c7bec4350fd5b822d4d718e1 -- can you confirm ?

#18 Updated by Mathieu Basille almost 9 years ago

Is this late fix already in the binaries for Debian?

I still cannot load raster from the DB manager with Debian Jessie (note that I just tried with Windows, and it worked without any problem). I tried with the latest release:

 *** 1:2.8.2+13jessie 0
        904 http://qgis.org/debian/ jessie/main amd64 Packages

as well as the development version:

 *** 1:2.9.0+git20150526+b91e43a+13jessie 0
        904 http://qgis.org/debian-nightly/ jessie/main amd64 

and I get more or less the same error message if I drag and drop, or if I use "Add to canvas":

GDAL provider: Cannot open GDAL dataset PG: `PG' does not exist in the file system, and is not recognised as a supported dataset name.

Raster Layer PG: dbname=<DB> host=xxx user=xxx port=5432 mode=2 schema=env_data column=rast table=etopo1_dem is an invalid layer and cannot be loaded [translated from French...]

(or)

GDAL provider: Cannot obtain the layer from GDAL raster (src/providers/gdal/qgsgdalprovider.cpp : 2521 : initBaseDataset) [translated from French...]

Raster Layer: The provider is invalid (provider gdal, URI : PG: dbname=<DB> host=xxx user=xxx password=xxx port=5432 mode=2 schema=env_data column=rast table=dem_srtm) [translated from French...]
(src/core/raster/qgsrasterlyaer.cpp : 668 : setDataProvider)

Is there anything else I could do to narrow the problem down?

Thank you,
Mathieu.

Edit: GDAL versions, if it helps

gdal-bin:
 *** 1.10.1+dfsg-8+b3 0
        800 http://ftp.us.debian.org/debian/ jessie/main amd64 Packages

libgdal1h:
 *** 1.10.1+dfsg-8+b3 0
        800 http://ftp.us.debian.org/debian/ jessie/main amd64 Packages

#19 Updated by Ruediger Brand over 8 years ago

I had the same error:

Cannot open GDAL dataset PG:
`PG' does not exist in the file system,
and is not recognised as a supported dataset name.

Following Version:

QGIS-Version 2.8.2-Wien QGIS-Codeversion 1b929ef
Kompiliert gegen Qt 4.8.5 Laufendes Qt 4.8.5
Kompiliert mit GDAL/OGR 1.11.2 Läuft mit GDAL/OGR 1.11.2
Kompiliert mit GEOS 3.4.2-CAPI-1.8.2 Läuft mit GEOS 3.4.2-CAPI-1.8.2 r3921
PostgreSQL-Client-Version 9.2.4 SpatiaLite-Version 4.1.1
QWT-Version 5.2.3 PROJ.4-Version 480
QScintilla2-Version 2.7.2

#20 Updated by Ruediger Brand over 8 years ago

more Information:

--> geotiff is rgb-color coded

#21 Updated by Giovanni Manghi about 8 years ago

Paolo Cavallini wrote:

Now it seems to work, except for -r (out of db) rasters, that crash QGIS

works fine on QGIS 2.8.4, Ubuntu 14.04, pgsql 9.3 and postgis 2.1

#22 Updated by Giovanni Manghi about 8 years ago

Paolo Cavallini wrote:

Apparently still valid: the result of st_resample cannot be read.

CREATE TABLE dtm1k
AS SELECT rid, ST_Resample(rast,1000,1000)
AS rast
FROM dtm_single;

works fine on QGIS 2.8.4, Ubuntu 14.04, pgsql 9.3 and postgis 2.1

even for out of db raster inputs.

#23 Updated by Giovanni Manghi about 8 years ago

not sure about Debian, but on Ubuntu I see no issues here.

#24 Updated by Giovanni Manghi about 8 years ago

  • Resolution set to worksforme

closing for lack of feedback, please reopen of necessary.

#25 Updated by Giovanni Manghi about 8 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF