QGIS Loads Black Screen For PostGIS Out-Db Raster Data

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

QGIS Loads Black Screen For PostGIS Out-Db Raster Data

Osahon Oduware
Hi All,

I have an out-db raster on PostGIS which I tried to load in QGIS (v 2.14.12-Essen) utilizing the DB Manager to establish a connection. I could view the raster table, but when I try to "Add to canvas" it displays a black screen instead of the raster image. 

I would be glad if someone could help me to resolve this.

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Loads Black Screen For PostGIS Out-Db Raster Data

Tumasgiu Rossini
Hi,

What is the format of your rasters ?
With your precedents messages in mind, I guess that the format is Mr.SID,
can you confirm that ?
(if so, then it means that you have managed your first postgis build, so congrats !)

It's important to give as much as detail as possible if you want help.
 

2017-04-18 15:43 GMT+02:00 Osahon Oduware <[hidden email]>:
Hi All,

I have an out-db raster on PostGIS which I tried to load in QGIS (v 2.14.12-Essen) utilizing the DB Manager to establish a connection. I could view the raster table, but when I try to "Add to canvas" it displays a black screen instead of the raster image. 

I would be glad if someone could help me to resolve this.

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Loads Black Screen For PostGIS Out-Db Raster Data

Osahon Oduware
Hi Tumasgiu,

Sorry, for not updating you. Yes, I followed up on your suggestion and Regina, Adrian, and some others assisted me in building PostGIS with a MrSID-enabled GDAL. My Out-DB rasters are in the MrSID format.

This raster file exist on the filesystem and when it is loaded directly into QGIS it displays the image (aerial photo). Also, when the same file is stored in PostGIS as a raster (IN-DB), it can be viewed in QGIS (using the DB Manager tool). However, when I reference the same file as an OUT-DB raster in PostGIS (in this case only the metadata of the raster and the filepath to the raster file is stored), an attempt to view it in QGIS (using the DB Manager tool) results in a black image being displayed instead of the aerial photo.


On Wed, Apr 19, 2017 at 4:41 PM, Tumasgiu Rossini <[hidden email]> wrote:
Hi,

What is the format of your rasters ?
With your precedents messages in mind, I guess that the format is Mr.SID,
can you confirm that ?
(if so, then it means that you have managed your first postgis build, so congrats !)

It's important to give as much as detail as possible if you want help.
 

2017-04-18 15:43 GMT+02:00 Osahon Oduware <[hidden email]>:
Hi All,

I have an out-db raster on PostGIS which I tried to load in QGIS (v 2.14.12-Essen) utilizing the DB Manager to establish a connection. I could view the raster table, but when I try to "Add to canvas" it displays a black screen instead of the raster image. 

I would be glad if someone could help me to resolve this.

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Loads Black Screen For PostGIS Out-DbRaster Data

Regina Obe-2

Couple of updates here:

 

The srid issue with the raster2pgsql transforming instead of setting srid, I confirmed to be an unintentional feature (bug however you want to think of it).

 

I've patched it up here:

https://trac.osgeo.org/postgis/ticket/3738

 

I think this issue wasn't discovered because using the –Y (which means copy mode) is much more efficient than without –Y (which uses INSERT statements) and when you use the –Y, the system doesn't try to transform, and does do the correct set srid because the transform logic relies on ST_Transform which can't be done in copy mode.

 

So the work around for the broken versions is to use the –Y switch.  You should probably just always use the –Y switch when you don't need to transform, which you can't do very well with the broken version.

 

raster2pgsql -C -t 500x500 -R -Y -s 26918 -F -I C:/gisdata/*.jp2 nj_aerials

 

When I do that transform is not attempted and the rasters stay out of database, but the SRID is set to what I specified.

 

On a related note, I tested QGIS and ran into the same issue as Osahon that the out-db does not show.

 

However if I build overviews and select the out-db it shows until I zoom into the image.

 

I think this happens because zooming in forces it to use the out-db table instead of the overviews. I guess the driver is trying to use the raw bytes instead of using the built in raster functions for display.

Not sure how hard of a fix that would be to fix the GDAL postgis raster driver as I suspect it's the GDAL driver at fault and not QGIS.

 

Hope this helps,

Regina

 

From: postgis-users [mailto:[hidden email]] On Behalf Of Osahon Oduware
Sent: Wednesday, April 19, 2017 11:52 AM
To: PostGIS Users Discussion <[hidden email]>
Subject: Re: [postgis-users] QGIS Loads Black Screen For PostGIS Out-DbRaster Data

 

Hi Tumasgiu,

Sorry, for not updating you. Yes, I followed up on your suggestion and Regina, Adrian, and some others assisted me in building PostGIS with a MrSID-enabled GDAL. My Out-DB rasters are in the MrSID format.

This raster file exist on the filesystem and when it is loaded directly into QGIS it displays the image (aerial photo). Also, when the same file is stored in PostGIS as a raster (IN-DB), it can be viewed in QGIS (using the DB Manager tool). However, when I reference the same file as an OUT-DB raster in PostGIS (in this case only the metadata of the raster and the filepath to the raster file is stored), an attempt to view it in QGIS (using the DB Manager tool) results in a black image being displayed instead of the aerial photo.

 

 

On Wed, Apr 19, 2017 at 4:41 PM, Tumasgiu Rossini <[hidden email]> wrote:

Hi,

What is the format of your rasters ?

With your precedents messages in mind, I guess that the format is Mr.SID,

can you confirm that ?

(if so, then it means that you have managed your first postgis build, so congrats !)

It's important to give as much as detail as possible if you want help.
 

 

2017-04-18 15:43 GMT+02:00 Osahon Oduware <[hidden email]>:

Hi All,

 

I have an out-db raster on PostGIS which I tried to load in QGIS (v 2.14.12-Essen) utilizing the DB Manager to establish a connection. I could view the raster table, but when I try to "Add to canvas" it displays a black screen instead of the raster image. 

 

I would be glad if someone could help me to resolve this.

 

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users

 


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users

 


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: QGIS Loads Black Screen For PostGIS Out-DbRaster Data

Osahon Oduware
Hi Regina,

Yes, the information you provided is very helpful. Thanks a lot.

On Sun, Apr 23, 2017 at 9:56 PM, Regina Obe <[hidden email]> wrote:

Couple of updates here:

 

The srid issue with the raster2pgsql transforming instead of setting srid, I confirmed to be an unintentional feature (bug however you want to think of it).

 

I've patched it up here:

https://trac.osgeo.org/postgis/ticket/3738

 

I think this issue wasn't discovered because using the –Y (which means copy mode) is much more efficient than without –Y (which uses INSERT statements) and when you use the –Y, the system doesn't try to transform, and does do the correct set srid because the transform logic relies on ST_Transform which can't be done in copy mode.

 

So the work around for the broken versions is to use the –Y switch.  You should probably just always use the –Y switch when you don't need to transform, which you can't do very well with the broken version.

 

raster2pgsql -C -t 500x500 -R -Y -s 26918 -F -I C:/gisdata/*.jp2 nj_aerials

 

When I do that transform is not attempted and the rasters stay out of database, but the SRID is set to what I specified.

 

On a related note, I tested QGIS and ran into the same issue as Osahon that the out-db does not show.

 

However if I build overviews and select the out-db it shows until I zoom into the image.

 

I think this happens because zooming in forces it to use the out-db table instead of the overviews. I guess the driver is trying to use the raw bytes instead of using the built in raster functions for display.

Not sure how hard of a fix that would be to fix the GDAL postgis raster driver as I suspect it's the GDAL driver at fault and not QGIS.

 

Hope this helps,

Regina

 

From: postgis-users [mailto:[hidden email]] On Behalf Of Osahon Oduware
Sent: Wednesday, April 19, 2017 11:52 AM
To: PostGIS Users Discussion <[hidden email]>
Subject: Re: [postgis-users] QGIS Loads Black Screen For PostGIS Out-DbRaster Data

 

Hi Tumasgiu,

Sorry, for not updating you. Yes, I followed up on your suggestion and Regina, Adrian, and some others assisted me in building PostGIS with a MrSID-enabled GDAL. My Out-DB rasters are in the MrSID format.

This raster file exist on the filesystem and when it is loaded directly into QGIS it displays the image (aerial photo). Also, when the same file is stored in PostGIS as a raster (IN-DB), it can be viewed in QGIS (using the DB Manager tool). However, when I reference the same file as an OUT-DB raster in PostGIS (in this case only the metadata of the raster and the filepath to the raster file is stored), an attempt to view it in QGIS (using the DB Manager tool) results in a black image being displayed instead of the aerial photo.

 

 

On Wed, Apr 19, 2017 at 4:41 PM, Tumasgiu Rossini <[hidden email]> wrote:

Hi,

What is the format of your rasters ?

With your precedents messages in mind, I guess that the format is Mr.SID,

can you confirm that ?

(if so, then it means that you have managed your first postgis build, so congrats !)

It's important to give as much as detail as possible if you want help.
 

 

2017-04-18 15:43 GMT+02:00 Osahon Oduware <[hidden email]>:

Hi All,

 

I have an out-db raster on PostGIS which I tried to load in QGIS (v 2.14.12-Essen) utilizing the DB Manager to establish a connection. I could view the raster table, but when I try to "Add to canvas" it displays a black screen instead of the raster image. 

 

I would be glad if someone could help me to resolve this.

 

_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users

 


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users

 


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users