<div dir="ltr">You can use the map algebra function combined with Common Table expressions.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 9, 2017 at 4:20 AM, David Westcott <span dir="ltr"><<a href="mailto:david.westcott@uk.rsagroup.com" target="_blank">david.westcott@uk.rsagroup.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div class="m_1071709777565061923WordSection1">
<p class="MsoNormal">Dear Post GIS Users<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there a way in PostGIS of applying a formula to more than two Raster layers?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">For example, I want to derive a new Raster Layer calculated as follows:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Constant1 x Layer1 x (Layer2 ^ Constant2) + Constant3 x Layer3 x (Layer4 ^ Constant4) + Constant5 x Layer5 x (Layer6 ^ Constant6)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Where  Constant1, Constant2, Constant3, Constant4, Constant5 & Constant6 are fixed constants.<u></u><u></u></p>
<p class="MsoNormal">                Layer1, Layer2, Layer3, Layer4, Layer5 & Layer6 are already derived Raster Layers.<u></u><u></u></p>
<p class="MsoNormal">                The ‘^’ sign represents raised to the power of. (i.e. 3^2 = 9).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">How would I apply such a formula in PostGIS?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Kind Regards<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">David Westcott<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br clear="both">
Please consider the environment before printing this email. RSA are proud to be a responsible business -  <a href="http://www.rsagroup.com/corporate-responsibility" target="_blank">www.rsagroup.com/corporate-<wbr>responsibility</a><br>
<br>
******************************<wbr>******************************<wbr>******************************<wbr>******************************<wbr>******************************<wbr>***************************<br>
Royal & Sun Alliance Insurance plc (No. 93792). Registered in England & Wales at St. Mark's Court, Chart Way, Horsham, West Sussex, RH12 1XL.<br>
<br>
Authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority. <br>
For your protection, telephone calls may be recorded and monitored. <br>
The information in this e-mail is confidential and may be read, copied or used only by the intended recipients. If you have received it in error please contact the<br>
sender immediately by returning the e-mail. Please delete the e-mail and do not disclose any of its contents to anyone. <br>
No responsibility is accepted for loss or damage arising from viruses or changes made to this message after it was sent.<br>
******************************<wbr>******************************<wbr>******************************<wbr>******************************<wbr>******************************<wbr>***************************<br>
</div>

<br>______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>