[postgis-users] I am probably being stupid but I cannot get my rasters to display using QGIS

Paragon Corporation lr at pcorp.us
Sat Nov 7 10:01:59 PST 2015


Darrel,

 

As I recall, I have to double-check, but if you imported the rasters with overview flag -- -l,  I think QGIS uses the overview tables and from memory is about 10 times faster.

 

In PostGIS 2.2.0 there is a built-in ST_CreateOverview function so you don't need to reload the data. 

http://postgis.net/docs/manual-2.2/RT_CreateOverview.html

 

I'm ashamed to say I haven't gotten around to using the new 2.2 feature, but please give it a try and see how it works for you.

 

 

Thanks for alerting us to the issue,

Regina

 

 

 

From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Darrel Maddy
Sent: Saturday, November 07, 2015 10:31 AM
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
Subject: Re: [postgis-users] I am probably being stupid but I cannot get my rasters to display using QGIS

 

Dear Chris / Regina

 

Many thanks.  I have been trying to solve this issue on two machines depending on where I was sitting! 

 

I have so far made the changes suggested by Regina only on my laptop and had assumed they did not work because of the failure. As Christian pointed out it appears the latest problem on my laptop was an unstable connection to the database. I have now resolved that and the changes made, as suggested by Regina ,seem to have resolved the initial issue (which seems to be down to the storage of doubles in the tif). 

 

I can now select and view the tifs individually, albeit the speed of rendering is VERY slow (I have an i7 laptop and would have expected this to be quicker – I will try it on my much more powerful workstation later). 

 

Regina, many thanks again for your help – there is no way I would have sorted that issue. It also makes me feel less stupid, as it appears the issue was real and not just because of an incompetent user (although I am probably still the latter). Christian thanks for alerting me to the compound problem.

 

Best wishes

 

Darrel

 

From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Christian Yrrman
Sent: 7 November, 2015 2:14 PM
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org> >
Subject: Re: [postgis-users] I am probably being stupid but I cannot get my rasters to display using QGIS

 

Hi Darrel,

did you save the password for the db connection in qgis' dbmanager? If not you'll get the same error.. (i.e. you are not being prompted for a password again)

Also, there are two ways of adding a raster table to qgis with dbmanager:

1. by right-clicking "Add to Canvas" and

2. by drag+dropping it to the layers panel.

Method (2) gives more meaningful error messages.

Good luck!!

Chris

 

 

 

On Sat, Nov 7, 2015 at 2:23 PM, Darrel Maddy <darrel.maddy at newcastle.ac.uk <mailto:darrel.maddy at newcastle.ac.uk> > wrote:

Dear Regina,

 

Many thanks for trying to help this is much appreciated.

 

I replaced the function as directed (at least I believe I did!). I removed the table constraints as directed and then created the view as directed. This was done on my laptop so the names are slightly different as I inserted the data table into the ch01 schema.

 

Unfortunately when I try to add the view or the raster directly in QGIS I get :

 

2015-11-07T13:08:34 0 QGIS starting...

2015-11-07T13:08:35 0 Python support ENABLED :-) 

2015-11-07T13:08:49 0 Application state:

QGIS_PREFIX_PATH env var: C:/PROGRA~1/QGISPI~1/apps/qgis

Prefix: C:/PROGRA~1/QGISPI~1/apps/qgis

Plugin Path: C:/PROGRA~1/QGISPI~1/apps/qgis/plugins

Package Data Path: C:/PROGRA~1/QGISPI~1/apps/qgis/.

Active Theme Name: default

Active Theme Path: :/images/themes/default/

Default Theme Path: :/images/themes/default/

SVG Search Paths: C:/PROGRA~1/QGISPI~1/apps/qgis/./svg/

C:/Users/ndm12/.qgis2//svg/

User DB Path: C:/PROGRA~1/QGISPI~1/apps/qgis/./resources/qgis.db

2015-11-07T13:08:49 0 QGIS Ready!

2015-11-07T13:09:32 1 PG: dbname=postgis_in_action port=5433 mode=2 schema=ch01 column=rast table=testrast is an invalid layer - not loaded

2015-11-07T13:18:50 1 PG: dbname=postgis_in_action port=5433 mode=2 schema=ch01 column=rast table=test is an invalid layer - not loaded

 

This is curious as the original tif file loads without error into QGIS directly.

 

 

Running your query returns

r_table_catalog          r_table_schema          r_table_name             r_raster_column         srid            scale_x                  scale_y      blocksize_x                  blocksize_y                  same_alignment         regular_blocking                  num_bands                 pixel_types                  nodata_values             out_db       extent                  spatial_index

postgis_in_action        ch01          test            rast            27700        None          None          2928          2960                  True           False          1                [u'64BF']    [-9999.0]   [False]                  0103000020346C00000100000005000000E0CCCCCCB1D517418066666692BE0541E0CCCCCCB1D517418066666692F80C41E0CCCCCCB1681B418066666692F80C41E0CCCCCCB1681B418066666692BE0541E0CCCCCCB1D517418066666692BE0541                  True

postgis_in_action        ch01          testrast      rast            0                None          None          None          None                  False          False          None          None          None          None          None          False

 

 

Darrel


_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org> 
http://lists.osgeo.org/mailman/listinfo/postgis-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20151107/08e9554d/attachment.html>


More information about the postgis-users mailing list