[Qgis-user] Problem with QGIS Raster Visualization form PostGIS

Marks, Constant Constant.Marks at unt.edu
Thu Jun 27 12:30:37 PDT 2019


I am having an issue importing and visualizing PostGIS raster layers in QGIS.   When I import the table I get the geometry but not the images.  I will describe my process below.

Server Side:
I downloaded the Global Human Settlement Raster(http://cidportal.jrc.ec.europa.eu/ftp/jrc-opendata/GHSL/GHS_SMOD_POP_GLOBE_R2016A/GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k/V1-0/ ) from https://ghsl.jrc.ec.europa.eu/datasets.php onto my Postgres-10/PostGIS-3 Server.

These are the files in the download:

GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif
GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif.aux.xml
GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif.ovr
GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif.vat.cpg
GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif.vat.dbf

I run gdalinfo:

$ gdalinfo *.tif
Driver: GTiff/GeoTIFF
Files: GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif
       GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif.ovr
       GHS_SMOD_POP2015_GLOBE_R2016A_54009_1k_v1_0.tif.aux.xml
Size is 35497, 15236
Coordinate System is:
PROJCS["World_Mollweide",
    GEOGCS["GCS_WGS_1984",
        DATUM["D_WGS_1984",
            SPHEROID["WGS_1984",6378137.0,298.257223563]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Mollweide"],
    PARAMETER["False_Easting",0.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",0.0],
    UNIT["Meter",1.0]]
Origin = (-17619594.547443531453609,8751029.461868489161134)
Pixel Size = (1000.000000000000000,-1000.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-17619594.547, 8751029.462)
Lower Left  (-17619594.547,-6484970.538)
Upper Right (17877405.453, 8751029.462)
Lower Right (17877405.453,-6484970.538)
Center      (  128905.453, 1133029.462) (  1d17'47.25"E,  9d10'43.07"N)
Band 1 Block=512x512 Type=Byte, ColorInterp=Gray
  Min=0.000 Max=3.000
  Minimum=0.000, Maximum=3.000, Mean=0.055, StdDev=0.249
  Overviews: 17749x7618, 8875x3809, 4438x1905, 2219x953, 1110x477
  Metadata:
    STATISTICS_MAXIMUM=3
    STATISTICS_MEAN=0.054612442564741
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=0.24926505885785


Next I imported the data into the database using the raster2pgsql command:

raster2pgsql -s 54009 -d -I -C -M *0.tif -F -R -t 1000x1000  public.smod | psql -U postgres -d trustmap -v ON_ERROR_STOP=1

This results in a new smod table in the public schema of my_db with columns for rid, rast, and  filename and 576 rows.

Host Side:

On the host I am running Windows 10 with QGIS 3.6.3

I can add a connection to db and see the tables.

And I can open the DB manager and inspect my table.


Next I load a Query Table with the DB Manager with:

select rid, rast::geometry from smod and load it.

The problem is that it looks like I have It all the shapes right but I cannot see the image!!! Only the polygons that represent the rows in my table.

Please help me visualize this.    I know the raster is good from a direct import of the raster in QGIS but I want to hold all the data on the server.
Please Help. Thanks!

Constant Marks
Research Assistant | Computer Science and Engineering
University of North Texas
Office: Discovery Parks F216
e: constant.marks at unt.edu<mailto:constant.marks at unt.edu>
t: (303) 482 7292<tel:482%207292>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20190627/8a863ad8/attachment.html>


More information about the Qgis-user mailing list