<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=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
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";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
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 lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>To display raster data, you can try ST_DumpAsPolygons into Arcgis or OpenJump (if it is just a test, you could add a where clause on tile id).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>WITH a AS (select ST_DumpAsPolygons(rast) AS mydump from deforested_areas –where rid = 1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>SELECT (mydump).val, (mydump).geom FROM a<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>This website is a bit outdated, but you can find some useful insights : http://trac.osgeo.org/postgis/wiki/WKTRaster<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'>Hug<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB style='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 style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FR'>De :</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FR'> postgis-users-bounces@lists.osgeo.org [mailto:postgis-users-bounces@lists.osgeo.org] <b>De la part de</b> Roberto Lazarte Kaqui<br><b>Envoyé :</b> mardi 31 mars 2015 15:11<br><b>À :</b> postgis-users@lists.osgeo.org<br><b>Objet :</b> [postgis-users] Problem to visualize raster data from PostGIS inQGIS<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>I have two multiband raster files and i'm trying to load these data into PostGIS using<span class=apple-converted-space> “</span></span><span lang=EN-US style='font-family:"Helvetica","sans-serif";color:#333333'>raster2pgsql”</span><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>Here is the syntax that i used:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>raster2pgsql -c -s 4326 -I -t 100x100 *.tif  public.deforested_rasters | psql -d r342471958<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><o:p> </o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:13.5pt;vertical-align:baseline'><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>It works without error, but i don't know if the command loads correctly both raster files. The database in PostGIS has two columns, one with the spatial index and the other one with raster information. I'm trying to visualize the resultant database in QGIS, but for some reason it doesn't open the raster layer.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;line-height:13.5pt;vertical-align:baseline;orphans: auto;widows: 1;-webkit-text-stroke-width: 0px;background-color:rgba(248, 248, 248, 0.6);word-spacing:0px'><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>I've tried to solve this problem using this idea:<span class=apple-converted-space> </span></span><span lang=PT-BR style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><a href="https://duncanjg.wordpress.com/2012/11/20/the-basics-of-postgis-raster/"><span lang=EN-US style='color:#358DAA;border:none windowtext 1.0pt;padding:0cm'>https://duncanjg.wordpress.com/2012/11/20/the-basics-of-postgis-raster/</span></a></span><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>, transforming the raster data to geometry data through DB manager using this command:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>select rid,rast::geometry from deforested_rasters<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><o:p> </o:p></span></p><p style='mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:13.5pt;vertical-align:baseline'><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>but when visualized in QGIS, only returns a rectangular area without the original characteristics.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;line-height:13.5pt;vertical-align:baseline;orphans: auto;widows: 1;-webkit-text-stroke-width: 0px;background-color:rgba(248, 248, 248, 0.6);word-spacing:0px'><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>Any ideas of how can i confirm that the<span class=apple-converted-space> “</span>raster2pgsql” command loads correctly the raster files? Or a different way to load these data into PostGIS?<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;line-height:13.5pt;vertical-align:baseline;orphans: auto;widows: 1;-webkit-text-stroke-width: 0px;background-color:rgba(248, 248, 248, 0.6);word-spacing:0px'><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>The raster files are available in:</span><span lang=PT-BR style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><a href="https://www.dropbox.com/sh/nu8nl6cigv8viz1/AADTrr_w8SCstDHOu6AiGeJta?dl=0"><span lang=EN-US style='color:#358DAA;border:none windowtext 1.0pt;padding:0cm'>https://www.dropbox.com/sh/nu8nl6cigv8viz1/AADTrr_w8SCstDHOu6AiGeJta?dl=0</span></a></span><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Helvetica","sans-serif";color:#333333'>Roberto<o:p></o:p></span></p><p class=MsoNormal><span lang=PT-BR><o:p> </o:p></span></p></div></body></html>