<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Raster Calculator error using AND / OR in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666477#M9642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you! Now I can manage. I studied also the material provided by links, but I did not notice the need for using parentheses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Mar 2012 17:25:50 GMT</pubDate>
    <dc:creator>AnneKull1</dc:creator>
    <dc:date>2012-03-29T17:25:50Z</dc:date>
    <item>
      <title>Raster Calculator error using AND / OR</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666475#M9640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have problems using RasterCalculator with ArcGIS10. Raster Calculator give errors when using operators AND and OR. For example when I write &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"landuse" == 2 &amp;amp; "slope" &amp;lt; 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I get an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Raster Calculator): RasterCalculator ""landuse" == 2 &amp;amp; "slope" &amp;lt; 5" C:\Temp\3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Mar 29 17:43:04 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Raster(r"landuse") == 2 &amp;amp; Raster(r"slope") &amp;lt; 5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression: rcexec() &amp;lt;type 'exceptions.ValueError'&amp;gt;: The truth value of a raster is ambiguous.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Raster Calculator).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Raster Calculator works fine when I do not use operators AND / OR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything worked fine in ArcGIS 9.3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone suggest how to solve the problem? In ArcGIS10 there are not anymore any alternatives to Raster Calculator either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 13:46:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666475#M9640</guid>
      <dc:creator>AnneKull1</dc:creator>
      <dc:date>2012-03-29T13:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator error using AND / OR</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666476#M9641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Everything worked fine in ArcGIS 9.3.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10.0 there is a new interface to map algebra that leverages Python as a the new interface to the Spatial Analyst tools. This is a pain in the short term, but in the long term this is much better because this new setup replaces no less than four inconsistent interfaces (SOMA, MOMA, Raster Calculator, Tool) to the Spatial Analyst tools in 9.x.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Arc 10 Help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;Working" rel="nofollow" target="_blank"&amp;gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Working_with_operators/00p600000008000000/]Working&lt;/A&gt;&lt;SPAN&gt; with Operators&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;Boolean" rel="nofollow" target="_blank"&amp;gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000009t000000.htm]Boolean&lt;/A&gt;&lt;SPAN&gt; And &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="&amp;lt;/span&amp;gt;&amp;lt;a" target="_blank"&gt;Comparing" rel="nofollow" target="_blank"&amp;gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00p600000018000000.htm]Comparing&lt;/A&gt;&lt;SPAN&gt; Map Algebra between ArcGIS 9.x and 10&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for your syntax, it is not getting parsed right - though perhaps it should be. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parentheses solve the problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;("landuse" == 2) &amp;amp; ("slope" &amp;lt; 5)&lt;/PRE&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 14:30:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666476#M9641</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-03-29T14:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator error using AND / OR</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666477#M9642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you! Now I can manage. I studied also the material provided by links, but I did not notice the need for using parentheses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anne&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 17:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666477#M9642</guid>
      <dc:creator>AnneKull1</dc:creator>
      <dc:date>2012-03-29T17:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator error using AND / OR</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666478#M9643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you! Now I can manage. I studied also the material provided by links, but I did not notice the need for using parentheses.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What tripped you (and has tripped me) up are the Python rules of operator precedence. This must have tripped up a lot of people during testing because the following text is included in the Arc 10 help on Raster Calculator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;When multiple operators are used in an expression, they are not necessarily executed in left-to-right order. The operator with the highest precedence value will be executed first. For more information on operator precedence, see operator precedence table. You can use parentheses to control the execution order.&lt;BR /&gt;&lt;BR /&gt;Boolean (~, &amp;amp;, ^, |) operators have a higher precedence level than Relational (&amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=, ==, !=) operators. Therefore, when Boolean operators are used in the same expression as Relational operators, the Boolean operators will be executed first. To change the order of execution, use parentheses.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 12:57:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error-using-and-or/m-p/666478#M9643</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-03-30T12:57:12Z</dc:date>
    </item>
  </channel>
</rss>

