Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get error message Invalid Layer When I add raster layer from DB_Manager in QGIS 3.4.6 #29659

Closed
qgib opened this issue Apr 13, 2019 · 10 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin Feedback Waiting on the submitter for answers

Comments

@qgib
Copy link
Contributor

qgib commented Apr 13, 2019

Author Name: Navid Taheri (Navid Taheri)
Original Redmine Issue: 21844
Affected QGIS version: 3.4.6
Redmine category:db_manager


I downloaded two rasters from site: srtm.csi.cgiar.org/srtmdata/ after that I did import them to my PostgreSQL database
It seem those files imported without any problem I checked by SQL queries moreover I can add them without
any problem to my map through Layer > Add Layer > Add Raster Layer But when I want add them via DB_Manager or Layer > Add Layer > Add PostGIS Layers, I got error messages:

"Invalid Layer: GDAL provider Cannot open GDAL dataset PG: dbname='zigmamap' host=localhost user=postgres port=5432 mode=2 schema='public' column='rast' table='srtm_48_06': Couldn't establish a database connection Raster layer Provider is not valid (provider: gdal, URI: PG: dbname='zigmamap' host=localhost user=postgres port=5432 mode=2 schema='public' column='rast' table='srtm_48_06'"


@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2019

Author Name: Giovanni Manghi (@gioman)


I cannot confirm, downloaded a raster from the same source, loaded it in postgresql (used 9 and 10) with raster2pgsql and always been able to add it to qgis using the db manager (tested also on both Linux and Windows).


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2019

Author Name: Navid Taheri (Navid Taheri)


Giovanni Manghi wrote:

I cannot confirm, downloaded a raster from the same source, loaded it in postgresql (used 9 and 10) with raster2pgsql and always been able to add it to qgis using the db manager (tested also on both Linux and Windows).

Thank you so much, I'm using PostgreSQL latest version (11.2) in LMDE 3 X64 but based on you answer I think this problem is not relate to postgresql, I did import rasters in many way based on raster2pgsql manual in Postgis.net,I'd many try even I tried with asc format, may I ask you write your command line you used for importing rasters? I will check again with your method
Thanks a bunch

@qgib
Copy link
Contributor Author

qgib commented Apr 14, 2019

Author Name: Giovanni Manghi (@gioman)


Navid Taheri wrote:

Giovanni Manghi wrote:

I cannot confirm, downloaded a raster from the same source, loaded it in postgresql (used 9 and 10) with raster2pgsql and always been able to add it to qgis using the db manager (tested also on both Linux and Windows).

Thank you so much, I'm using PostgreSQL latest version (11.2) in LMDE 3 X64 but based on you answer I think this problem is not relate to postgresql, I did import rasters in many way based on raster2pgsql manual in Postgis.net,I'd many try even I tried with asc format, may I ask you write your command line you used for importing rasters? I will check again with your method
Thanks a bunch

i.e.

raster2pgsql -s 4326 -I -M -C srtm_35_05.tif mdtteste > mdtteste.sql

then

sql -U teste -h localhost -f mdtteste.sql

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2019

Author Name: Navid Taheri (Navid Taheri)


Giovanni Manghi wrote:

Navid Taheri wrote:

Giovanni Manghi wrote:

I cannot confirm, downloaded a raster from the same source, loaded it in postgresql (used 9 and 10) with raster2pgsql and always been able to add it to qgis using the db manager (tested also on both Linux and Windows).

Thank you so much, I'm using PostgreSQL latest version (11.2) in LMDE 3 X64 but based on you answer I think this problem is not relate to postgresql, I did import rasters in many way based on raster2pgsql manual in Postgis.net,I'd many try even I tried with asc format, may I ask you write your command line you used for importing rasters? I will check again with your method
Thanks a bunch

i.e.

raster2pgsql -s 4326 -I -M -C srtm_35_05.tif mdtteste > mdtteste.sql

then

sql -U teste -h localhost -f mdtteste.sql

Thank you much, I found out, When I select rater in DB_Manager and then right click on that and select add to Canvas option it's Ok It added without any error message add to my map without problem, But when I want add to Canvas via drag and drop I got that error I described earlier, I don't know why drag and drop and add PostGIS didn't work without any problem for me but it is not important I'll add my raster DB_Manager > Add To Canvas.

Thank you so much

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2019

Author Name: Giovanni Manghi (@gioman)


Thank you much, I found out, When I select rater in DB_Manager and then right click on that and select add to Canvas option it's Ok It added without any error message add to my map without problem, But when I want add to Canvas via drag and drop I got that error I described earlier, I don't know why drag and drop and add PostGIS didn't work without any problem for me but it is not important I'll add my raster DB_Manager > Add To Canvas.

Thank you so much

works ok for me with d&d, double click, and right click > add to canvas

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2019

Author Name: Navid Taheri (Navid Taheri)


Giovanni Manghi wrote:

Thank you much, I found out, When I select rater in DB_Manager and then right click on that and select add to Canvas option it's Ok It added without any error message add to my map without problem, But when I want add to Canvas via drag and drop I got that error I described earlier, I don't know why drag and drop and add PostGIS didn't work without any problem for me but it is not important I'll add my raster DB_Manager > Add To Canvas.

Thank you so much

works ok for me with d&d, double click, and right click > add to canvas
I don't know why work for you perfect, I'd wish work for me like you but It didn't, but for only work DB_Manager > Add To Canvas, Is it possible because PostgreSQL version? I'm using PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2019

Author Name: Giovanni Manghi (@gioman)


I don't know why work for you perfect, I'd wish work for me like you but It didn't, but for only work DB_Manager > Add To Canvas, Is it possible because PostgreSQL version? I'm using PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit

can you test on pgsql 9/10?

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2019

Author Name: Navid Taheri (Navid Taheri)


Giovanni Manghi wrote:

I don't know why work for you perfect, I'd wish work for me like you but It didn't, but for only work DB_Manager > Add To Canvas, Is it possible because PostgreSQL version? I'm using PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit

can you test on pgsql 9/10?

No, No need thank you so much, If I'll be able add raster to map by add to canvas it is enough for me, I hope in new QGIS update it can be more compatible with postgresql latest version because postgresql is growing very fast.

Thank for taking your time 🙏🤞

@qgib
Copy link
Contributor Author

qgib commented May 6, 2019

Author Name: Paolo Cavallini (@pcav)


I don't think it's the pg version, It works smoothly for me on pg11

@qgib qgib added Feedback Waiting on the submitter for answers Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin labels May 25, 2019
@alexbruy
Copy link
Contributor

Works fine in master and 3.4. Please reopen if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin Feedback Waiting on the submitter for answers
Projects
None yet
Development

No branches or pull requests

2 participants