1

I am quite new to this process (using raster data in PostGIS) and tried to find some tips/solutions on other threads but I didn't manage to get things working.

I ingested some Landsat data into my database using:

raster2pgsql -I -C -s 28356 LS7_20150425_B50.tif public.LS7_20150425_B50 | psql –d postgres –U postgres

And everything is working fine : I see my new table LS7_20150425_B50 with two columns (rid and rast) and I am able to compute some stats on my raster using ST_SummaryStats().

However, I'd like to display my raster in QGIS (2.12.0 Lyon) using the DB Manager. However, when I am adding the table to the canvas I am getting an error message:

PG: dbname=postgres host=localhost user=postgres port=9999 mode=2 schema=public column=rast table=ls7_etm_nbar_p54_ganbar01-002_089_078_20150425_b40 is not a valid layer.

Do you have any idea?

  • 1
    Is layer name not limited in length? Your table name is 50 characters long... Maybe try with a shorter name. – wiltomap Nov 18 '15 at 16:05
  • @wiltomap I tried to rename my table with a shorter name "b10" and I am still getting the same error message : PG: dbname=postgres host=localhost user=postgres port=9999 mode=2 schema=public column=rast table=b10 is not a valid layer and cannot be loaded. – pvillard Nov 18 '15 at 16:50
  • @wiltomap In fact after restarting QGIS, it is now working fine. I don't know if it is related to the name length or not. Thanks for your help ! – pvillard Nov 18 '15 at 17:19
  • Glad it worked! Welcome on GIS StackExchange. – wiltomap Nov 18 '15 at 19:55
1

The problem has not been solved by directly renaming the table names.

However, the problem has been solved after :

  • performing again the ingestion of rasters with shorter names for the tables in raster2pgsql commands
  • changing the language default to English on QGIS
  • restarting QGIS

I guess that the first point has been the real solution to solve my issue but just in case I prefer to mention the two other points.

Maybe this can also be related to this topic.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.