<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hi,<div>I have not used the raster calculator in a while but I am not sure about you use of the \.</div><div>Examples in the user manual (<a href="https://docs.qgis.org/3.16/en/docs/user_manual/working_with_raster/raster_analysis.html#raster-calculator">https://docs.qgis.org/3.16/en/docs/user_manual/working_with_raster/raster_analysis.html#raster-calculator</a>) use this as examples.</div><div><br></div><div><pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto; caret-color: rgb(64, 64, 64); color: rgb(64, 64, 64); -webkit-text-size-adjust: 100%; background-color: rgb(248, 248, 248);"><span class="p" style="box-sizing: border-box;">(</span><span class="s2" style="box-sizing: border-box; color: rgb(186, 33, 33);">"elevation@1"</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);"><</span> <span class="mi" style="box-sizing: border-box; color: rgb(102, 102, 102);">50</span><span class="p" style="box-sizing: border-box;">)</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">*</span> <span class="mi" style="box-sizing: border-box; color: rgb(102, 102, 102);">1</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">+</span> <span class="p" style="box-sizing: border-box;">(</span><span class="s2" style="box-sizing: border-box; color: rgb(186, 33, 33);">"elevation@1"</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">>=</span> <span class="mi" style="box-sizing: border-box; color: rgb(102, 102, 102);">50</span><span class="p" style="box-sizing: border-box;">)</span> <span class="o" style="box-sizing: border-box; color: rgb(102, 102, 102);">*</span> <span class="mi" style="box-sizing: border-box; color: rgb(102, 102, 102);">2</span></pre><div><br></div>I would try (expression 1) OR (expression 2). Layers names must be placed between quotes “”.</div><div><br></div><div>You could also update your QGIS version to 3.16. </div><div><br><div dir="ltr">Nicolas Cadieux<div><a href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a></div></div><div dir="ltr"><br><blockquote type="cite">Le 12 févr. 2021 à 09:09, Wanda Norman <wanda.mnorman2015@gmail.com> a écrit :<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">Greetings friends:</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">I am working on lesson 7.3.5 in the User Guide / Manual (QGIS 3.10) – Following along: Using the Raster Calculator.</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">I am having difficulty with the calculation formula as indicated below:</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">The manual states this formula should be used:</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> Aspect@1 <=90 OR Aspect@1 >= 270</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">Which I am assuming is incorrect because a) I get an error when I run it; and b) when I set the parameters using the expression operators the formula looks like this:</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> “Aspect@1” <=90 OR “Aspect@1” >=270</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">However, I still get the error:</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:"Times New Roman",serif;color:red">Error parsing formula</span><span style="font-size:12pt;font-family:"Times New Roman",serif"></span></p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:12pt;font-family:"Times New Roman",serif;color:red">Execution failed after 0.02 seconds</span></p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">With some help – I then tried this formula</p><p class="MsoNormal" style="margin:0in;text-indent:0.5in;font-size:11pt;font-family:Calibri,sans-serif">\“Aspect@1”\ <=90 OR \“Aspect@1”\ >=270</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">Which worked for this assignment.</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">However, moving on to lesson 7.3.6 – More criteria: which takes me to 21.12.2. Calculate slope (less than 2 and 5 degrees)</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">I get the same error as above again.</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">I am steadily working my way through the Manual and would appreciate any help. I am using QGIS version 3.10.9-A Coruna (64 bit) on a Windows PC.</p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif"> </p><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">Thank you!</p><font color="#888888"><p class="MsoNormal" style="margin:0in;font-size:11pt;font-family:Calibri,sans-serif">Wanda Norman</p></font></div>
<span>_______________________________________________</span><br><span>Qgis-user mailing list</span><br><span>Qgis-user@lists.osgeo.org</span><br><span>List info: https://lists.osgeo.org/mailman/listinfo/qgis-user</span><br><span>Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user</span><br></div></blockquote></div></body></html>