<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
p.ecxmsonormal, li.ecxmsonormal, div.ecxmsonormal
        {mso-style-name:ecxmsonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
p.ecxmsochpdefault, li.ecxmsochpdefault, div.ecxmsochpdefault
        {mso-style-name:ecxmsochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.ecxmsohyperlink
        {mso-style-name:ecxmsohyperlink;}
span.ecxmsohyperlinkfollowed
        {mso-style-name:ecxmsohyperlinkfollowed;}
span.ecxemailstyle17
        {mso-style-name:ecxemailstyle17;}
p.ecxmsonormal1, li.ecxmsonormal1, div.ecxmsonormal1
        {mso-style-name:ecxmsonormal1;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.ecxmsohyperlink1
        {mso-style-name:ecxmsohyperlink1;
        color:blue;
        text-decoration:underline;}
span.ecxmsohyperlinkfollowed1
        {mso-style-name:ecxmsohyperlinkfollowed1;
        color:purple;
        text-decoration:underline;}
span.ecxemailstyle171
        {mso-style-name:ecxemailstyle171;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
p.ecxmsochpdefault1, li.ecxmsochpdefault1, div.ecxmsochpdefault1
        {mso-style-name:ecxmsochpdefault1;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle30
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Jose Carlos,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for your answers. I know the option to “Add to Canvas” for a raster layer that shows up in the DBManager interface.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Problem is that I connect over the network, and Landsat images are typically 150 Mb per band. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This is why I prefer to select well-delineated areas that are reasonable in size, for which the raster selection query seem to be just the right solution.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Even better would be a “Add PostGIS raster layer” on the left menu, that would logically go for the re-sampled pyramid layers, if available in the database, or warn when really big images would be requested [over a network connection]. <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As a start, I guess I will have to dig out the old version of DBManager and restore the raster functionality…<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Guido<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> qgis-user-bounces@lists.osgeo.org [mailto:qgis-user-bounces@lists.osgeo.org] <b>On Behalf Of </b>José Carlos Martínez Llario<br><b>Sent:</b> 07 March 2014 10:45<br><b>To:</b> qgis-user@lists.osgeo.org<br><b>Subject:</b> Re: [Qgis-user] PostGIS raster access in QGIS using DBManager (or wktraster)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<br>you just have to add the layer from db manager directly, it is working with raster too.<br>I already did few days ago with QGIS 2.2 with PostGIS Raster, it worked really well better than other previous versions of QGIS.<br>cheers,<br>Jose Carlos Martinez<br><br><o:p></o:p></p><div><p class=MsoNormal>On 07/03/2014 10:40, José Pedro Santos wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='margin-bottom:12.0pt'>Ciao Guido,<br><br>DBManager is only for vector layers..In the version 1.8 existed a plugin for importing raster layers but wasn't update for this new version. <br><br>Regards,<br>José Santos <o:p></o:p></p><div><div class=MsoNormal align=center style='text-align:center'><hr size=3 width="100%" align=center id=stopSpelling></div><p class=MsoNormal style='margin-bottom:12.0pt'>From: <a href="mailto:guido.lemoine@jrc.ec.europa.eu">guido.lemoine@jrc.ec.europa.eu</a><br>To: <a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a><br>Date: Fri, 7 Mar 2014 07:51:33 +0100<br>Subject: [Qgis-user] PostGIS raster access in QGIS using DBManager (or wktraster)<o:p></o:p></p><div><p class=ecxmsonormal style='margin-bottom:12.0pt'>Dear QGIS users,<o:p></o:p></p><p class=ecxmsonormal>[This was posted on QGIS developer as well, but maybe I should seek the solution here]<o:p></o:p></p><p class=ecxmsonormal><br>I am using QGIS 2.2 .0 (Valmiera) and trying to load a raster query result via DBManager, using the following query:<br><br>select 1 as rid, st_union(st_band(rast, '4,3,2') ) as rast<br>from o_8_lc81970232013202lgn00_all_rds_sub, municipalities<br>where municipalities.wkb_geometry && rast<br>and munname = 'Veendam' <br><br>(in short: Band 4,3,2 of a raster2pgsql-loaded Landsat-8 image (overview 8 version) for a "municipality" polygon (administrative commune boundary).<br><br>Execute (F5) correctly returns a single row (and I can save the union result with ST_AsTIFF() to file in a script)<br><br>When I try to "Load as a new layer" to visualise the result in QGIS, I get the following error message:<br><br>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<br>from o_8_lc81970232013202lgn00_all_rds_sub, gemeentegebieden<br>where gemeentegebieden.wkb_geometry && rast<br>and gemnaam = 'Veendam' <br>) AS "subQuery_0" returned 7 [ERROR:  function geometrytype(raster) does not exist<br>LINE 1: SELECT DISTINCT upper(geometrytype("rast")),st_srid("rast") ...<br>                              ^<br>HINT:  No function matches the given name and argument types. You might need to add explicit type casts.<br>]<br><br>Apparently, my query get "wrapped"  in the SELECT DISTINCT outer query above (which obviously does not work).<br><br>Is this a known issue, and, if so, can it be modified, for instance by providing explicitly geometrytype and srid (and if so, how?).<br><br>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].<br><br>Thanks for all the wonderful stuff,<br><br>Guido Lemoine<o:p></o:p></p><p class=ecxmsonormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p><p class=ecxmsonormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> </span><o:p></o:p></p></div><p class=MsoNormal><br>_______________________________________________ Qgis-user mailing list <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></p></div></div><p class=MsoNormal><br><br><br><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Qgis-user mailing list<o:p></o:p></pre><pre><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><o:p></o:p></pre><pre><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div></body></html>