<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 15 (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:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.yiv3923198100msoacetate, li.yiv3923198100msoacetate, div.yiv3923198100msoacetate
{mso-style-name:yiv3923198100msoacetate;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.yiv3923198100msolistparagraph, li.yiv3923198100msolistparagraph, div.yiv3923198100msolistparagraph
{mso-style-name:yiv3923198100msolistparagraph;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.yiv3923198100msonormal, li.yiv3923198100msonormal, div.yiv3923198100msonormal
{mso-style-name:yiv3923198100msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.yiv3923198100msochpdefault, li.yiv3923198100msochpdefault, div.yiv3923198100msochpdefault
{mso-style-name:yiv3923198100msochpdefault;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.yiv3923198100msonormal1, li.yiv3923198100msonormal1, div.yiv3923198100msonormal1
{mso-style-name:yiv3923198100msonormal1;
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
p.yiv3923198100msoacetate1, li.yiv3923198100msoacetate1, div.yiv3923198100msoacetate1
{mso-style-name:yiv3923198100msoacetate1;
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma",sans-serif;
color:black;}
p.yiv3923198100msolistparagraph1, li.yiv3923198100msolistparagraph1, div.yiv3923198100msolistparagraph1
{mso-style-name:yiv3923198100msolistparagraph1;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;}
p.yiv3923198100msochpdefault1, li.yiv3923198100msochpdefault1, div.yiv3923198100msochpdefault1
{mso-style-name:yiv3923198100msochpdefault1;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:10.0pt;
font-family:"Times New Roman",serif;}
span.yiv3923198100msohyperlink
{mso-style-name:yiv3923198100msohyperlink;}
span.yiv3923198100msohyperlinkfollowed
{mso-style-name:yiv3923198100msohyperlinkfollowed;}
span.yiv3923198100htmlpreformattedchar
{mso-style-name:yiv3923198100htmlpreformattedchar;}
span.yiv3923198100balloontextchar
{mso-style-name:yiv3923198100balloontextchar;}
span.yiv3923198100emailstyle22
{mso-style-name:yiv3923198100emailstyle22;}
span.yiv3923198100emailstyle23
{mso-style-name:yiv3923198100emailstyle23;}
span.yiv3923198100emailstyle24
{mso-style-name:yiv3923198100emailstyle24;}
span.yiv3923198100emailstyle25
{mso-style-name:yiv3923198100emailstyle25;}
span.yiv3923198100emailstyle26
{mso-style-name:yiv3923198100emailstyle26;}
span.yiv3923198100emailstyle27
{mso-style-name:yiv3923198100emailstyle27;}
span.yiv3923198100emailstyle28
{mso-style-name:yiv3923198100emailstyle28;}
span.yiv3923198100emailstyle29
{mso-style-name:yiv3923198100emailstyle29;}
span.yiv3923198100emailstyle30
{mso-style-name:yiv3923198100emailstyle30;}
span.yiv3923198100emailstyle31
{mso-style-name:yiv3923198100emailstyle31;}
span.yiv3923198100msohyperlink1
{mso-style-name:yiv3923198100msohyperlink1;
color:#0563C1;
text-decoration:underline;}
span.yiv3923198100msohyperlinkfollowed1
{mso-style-name:yiv3923198100msohyperlinkfollowed1;
color:#954F72;
text-decoration:underline;}
span.yiv3923198100htmlpreformattedchar1
{mso-style-name:yiv3923198100htmlpreformattedchar1;
font-family:Consolas;
color:black;}
span.yiv3923198100balloontextchar1
{mso-style-name:yiv3923198100balloontextchar1;
font-family:"Tahoma",sans-serif;}
span.yiv3923198100emailstyle221
{mso-style-name:yiv3923198100emailstyle221;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.yiv3923198100emailstyle231
{mso-style-name:yiv3923198100emailstyle231;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle241
{mso-style-name:yiv3923198100emailstyle241;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle251
{mso-style-name:yiv3923198100emailstyle251;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.yiv3923198100emailstyle261
{mso-style-name:yiv3923198100emailstyle261;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle271
{mso-style-name:yiv3923198100emailstyle271;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle281
{mso-style-name:yiv3923198100emailstyle281;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle291
{mso-style-name:yiv3923198100emailstyle291;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle301
{mso-style-name:yiv3923198100emailstyle301;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.yiv3923198100emailstyle311
{mso-style-name:yiv3923198100emailstyle311;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle55
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle56
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle57
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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="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;mso-fareast-language:EN-US">Dear Brent,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Of course I will be happy to
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">J</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> This is how it looks now;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">SELECT (ST_SummaryStats(ST_Union(rast))).sum AS sum<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">FROM (SELECT ST_MapAlgebra(deposition.rast, concentrated.rast, 'CASE WHEN [rast2] > 0.0 THEN [rast1] ELSE NULL END' ) As rast<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> FROM mymodel.deposition, mymodel.concentrated<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> WHERE ST_UpperleftX(mymodel.deposition.rast) = ST_UpperleftX(mymodel.concentrated.rast) AND
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> ST_UpperleftY(mymodel.deposition.rast) = ST_UpperleftY(mymodel.deposition.rast) ) foo ;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">The query has been running now for several hours. I am therefore becoming less hopeful.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">There are 19584 256x256 tiles in each of the tables. Each table only has three columns which were created when I imported the tifs
– they are rid, rast and filename.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I am unfamiliar with building indexes so this could be slow because they lack the appropriate indexing. The number of cells with values
exceeding zero will be several million in each of the 5Million cell tifs and all data are stored as doubles.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I’m not sure at what point I should realise it is not going to work! The simpler add query is also running which makes me suspect
this may not be working.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Sadly I may have to resort to doing this manually in QGIS for the 135 untiled tiffs in each table
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">L</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I’ll keep you posted.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Best wishes<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Darrel<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Brent Wood [<a href="mailto:pcreso@yahoo.com">mailto:pcreso@yahoo.com</a>]
<br>
<b>Sent:</b> 24 November 2015 18:41<br>
<b>To:</b> Darrel Maddy <<a href="mailto:darrel.maddy@newcastle.ac.uk">darrel.maddy@newcastle.ac.uk</a>><br>
<b>Subject:</b> Re: [postgis-users] Help with SQL query?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div id="yui_3_16_0_1_1448337433794_69747">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black">Hi Darrel,<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70681">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black">This has been a useful thread for others than yourself!<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70682">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70683">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black">Can you post the entire final query once it is working? Otherwise we need to read through all the emails to build it up as you have done with advice from
the various correspondents. <o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70684">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70685">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black">Thanks,<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70686">
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Verdana",sans-serif;color:black"> Brent Wood<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70689">
<div id="yui_3_16_0_1_1448337433794_70688">
<div id="yui_3_16_0_1_1448337433794_70687">
<div class="MsoNormal" align="center" style="text-align:center;background:white">
<span style="font-family:"Helvetica",sans-serif;color:black">
<hr size="1" width="100%" align="center">
</span></div>
<p class="MsoNormal" style="background:white"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">From:</span></b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black"> Darrel Maddy <<a href="mailto:darrel.maddy@newcastle.ac.uk">darrel.maddy@newcastle.ac.uk</a>><br>
<b>To:</b> PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>>
<br>
<b>Sent:</b> Wednesday, November 25, 2015 2:00 AM<br>
<b>Subject:</b> Re: [postgis-users] Help with SQL query?</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70694">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"><o:p> </o:p></span></p>
<div id="yiv3923198100">
<div id="yui_3_16_0_1_1448337433794_70693">
<div id="yui_3_16_0_1_1448337433794_70692">
<div id="yui_3_16_0_1_1448337433794_70691">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D">Dear Birgit,</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70695">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70697">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D">Very many thanks. The query is now running – so it is no longer giving an error. I will not know for a few hours whether it is calculating the necessary
values but it seems progress is being made.</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70698">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70700">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D">I have a book coming on SQL – I clearly need to do my homework more thoroughly
</span><span style="font-family:Wingdings;color:#1F497D">J</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70701">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70703">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D">I will confirm when it stops!</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70704">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70705">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D">Best wishes</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70706">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70707">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D">Darrel</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70708">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70709">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70710">
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:#1F497D"> </span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_1_1448337433794_70715">
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in" id="yui_3_16_0_1_1448337433794_70714">
<div id="yui_3_16_0_1_1448337433794_70713">
<p class="MsoNormal" style="background:white"><b><span lang="EN-US" style="font-family:"Helvetica",sans-serif">From:</span></b><span lang="EN-US" style="font-family:"Helvetica",sans-serif"> postgis-users [<a href="mailto:postgis-users-bounces@lists.osgeo.org">mailto:postgis-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Birgit Laggner<br>
<b>Sent:</b> 24 November 2015 12:19<br>
<b>To:</b> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [postgis-users] Help with SQL query?</span><span style="font-family:"Helvetica",sans-serif;color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Helvetica",sans-serif;color:black"> <o:p></o:p></span></p>
</div>
<div style="margin-bottom:12.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-family:"Helvetica",sans-serif;color:black">Hi Darrel,<br>
<br>
my PostGIS version is too old for testing, but if I read the documentation right, then your expression has to be SQL. And IF THEN ELSE etc. is not SQL as far as I know - SQL has CASE WHEN.<br>
<br>
So, I would assume, you would need to write your expression like this:<br>
<br>
'CASE WHEN [rast2] > 0.0 THEN [rast1] ELSE NULL END'<br>
<br>
I am curious if this helps with your error...<br>
<br>
Regards,<br>
<br>
Birgit<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>