0

Hi I had loaded a satellite imagery in PostgreSql using command
"raster2pgsql -s 4326 -I -C -M E:\20Mar\55M1_Geo.tif -F -t 100x100 public.55M1_Geo | psql -d rasterdata -p 5437 -U postgres" and committed succesfully.

Now I want to open it in QGIS3 using DB Manager and during add to map canvas, it gives warning error "WARNING PG: dbname=rasterdata host=localhost user=postgres port=5437 mode=2 schema=public column=rast table=55m1_geo is an invalid layer - not loaded"

Below the PostgreSql credential it shows "Can not open GDAL dataset PG: dbname=rasterdata host=localhost user=postgres password=pgadmin port=5437 mode=2 schema=public column=rast table=55m1_geo", "testlayer" Couldnt establish a database connection"

postgresql error

A python error was occur after click database credentials as below:

File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\db_manager\db_plugins__init__.py", line 76, in
initDbPluginList()
File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\db_manager\db_plugins__init__.py", line 47, in initDbPluginList
exec(u"from .%s import plugin as mod" % name, globals())
File "string", line 1, in
File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1009, in _handle_fromlist
File "", line 205, in _call_with_frames_removed
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 674, in exec_module
File "", line 781, in get_code
File "", line 741, in source_to_code
File "", line 205, in _call_with_frames_removed

After that I had tried with "iface.addRasterLayer("PG: dbname=rasterdata host=localhost user=postgres password=pgadmin port=5437 mode=2 schema=public column=rast table=55m1_geo", "testlayer")" but get the error "2018-05-23T08:48:11 CRITICAL Invalid Layer : GDAL provider Cannot get GDAL raster band: Raster layer Provider is not valid (provider: gdal, URI: PG: dbname=rasterdata host=localhost user=postgres password=pgadmin port=5437 mode=2 schema=public column=rast table=55m1_geo"

The same way I had loaded SRTM DEM. It display perfectly there is no issue in that. What the problem with satellite images. Any one help.

  • Perhaps 55M1_Geo vs. 55m_1geo makes the issue. – user30184 May 23 '18 at 5:59
  • I had changed the name tp 55m1geo instead of 55M1_Geo, but same problem. – Sachin May 23 '18 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.