[Qgis-developer] PostGIS raster access in QGIS using DBManager (or wktraster)

Guido Lemoine guido.lemoine at jrc.ec.europa.eu
Wed Mar 5 06:36:21 PST 2014


Dear Developers,

I am using QGIS 2.2 .0 (Valmiera) and trying to load a raster query result
via DBManager, using the following query:

select 1 as rid, st_union(st_band(rast, '4,3,2') ) as rast
from o_8_lc81970232013202lgn00_all_rds_sub, gemeentegebieden
where gemeentegebieden.wkb_geometry && rast
and gemnaam = 'Veendam' 

(in short: Band 4,3,2 of a Landsat-8 image (overview 8 version) for a
"gemeente" polygon (administrative commune boundary).

Execute (F5) correctly returns a single row. 

When I try to "Load as a new layer" to visualise the result in QGIS, I get
the following error message:

Erroneous query: SELECT DISTINCT upper(geometrytype("rast")),st_srid("rast")
FROM (select 1 as rid, st_union(st_band(rast, '4,3,2') ) as rast
from o_8_lc81970232013202lgn00_all_rds_sub, gemeentegebieden
where gemeentegebieden.wkb_geometry && rast
and gemnaam = 'Veendam' 
) AS "subQuery_0" returned 7 [ERROR:  function geometrytype(raster) does not
exist
LINE 1: SELECT DISTINCT upper(geometrytype("rast")),st_srid("rast") ...
                              ^
HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.
]

Apparently, my query get "wrapped"  in the SELECT DISTINCT outer query above
(which obviously does not work).

Is this a known issue, and, if so, can it be modified, for instance by
providing explicitly geometrytype and srid (and if so, how?).

I also checked out the wktraster plugin, but that does not work for 2.2. Is
an upgrade expected soon [or should I try writing it myself].

Thanks for all the wonderful stuff,

Guido Lemoine

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140305/62dc69f4/attachment.html>


More information about the Qgis-developer mailing list