<?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: Difficulty in executing code in Raster Calculator in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658405#M9482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;A &amp;nbsp;Combine followed by a reclass is useful to avoid such ugly and error prone expressions... for next time&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/combine.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/combine.htm"&gt;Combine—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Sep 2016 20:23:07 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-09-09T20:23:07Z</dc:date>
    <item>
      <title>Difficulty in executing code in Raster Calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658400#M9477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am tring to execute an expression in Raster Calculator. It's rather a long piece of code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con("LULCyear2005_2006_500m_Raster" == 1 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 1, 0.5, Con("LULCyear2005_2006_500m_Raster" == 1 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 2, 0.55, Con("LULCyear2005_2006_500m_Raster" == 1 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 3, 0.6, Con("LULCyear2005_2006_500m_Raster" ==28 &amp;amp;&amp;nbsp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 1, 0.4,&amp;nbsp; Con("LULCyear2005_2006_500m_Raster" == 28 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 2, 0.7, Con("LULCyear2005_2006_500m_Raster" == 28 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 3, 0.82, Con("LULCyear2005_2006_500m_Raster" == 28 &amp;amp; "soilRaster_reclass" == 2 &amp;amp; "slope_reclass" == 1, 0.3, Con("LULCyear2005_2006_500m_Raster" == 28 &amp;amp; "soilRaster_reclass" == 2 &amp;amp; "slope_reclass" == 2, 0.4, Con("LULCyear2005_2006_500m_Raster" == 28 &amp;amp; "soilRaster_reclass" == 2 &amp;amp; "slope_reclass" == 3, 0.52, Con("LULCyear2005_2006_500m_Raster" == 71, 0.33, Con("LULCyear2005_2006_500m_Raster" == 77 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 1, 0.4, Con("LULCyear2005_2006_500m_Raster" == 78 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 2, 0.5, Con("LULCyear2005_2006_500m_Raster" == 78 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 3, 0.6, Con("LULCyear2005_2006_500m_Raster" == 78 &amp;amp; "soilRaster_reclass" == 2 &amp;amp; "slope_reclass" == 1, 0.1, Con("LULCyear2005_2006_500m_Raster" == 78 &amp;amp; "soilRaster_reclass" == 2 &amp;amp; "slope_reclass" == 3, 0.25, Con("LULCyear2005_2006_500m_Raster" == 78 &amp;amp; "soilRaster_reclass" == 2 &amp;amp; "slope_reclass" == 3, 0.3, Con("LULCyear2005_2006_500m_Raster" == 109, 0.41, Con("LULCyear2005_2006_500m_Raster" == 141,1))))))))))))))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its for preparing a map with appropriate Runoff coefficient value based on Landuse, Slope and Soil type. Unfortunately, each time I run it I come accross this error message:&amp;nbsp;&lt;IMG alt="Screenshot of error message" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/224826_error.jpg" style="width: 620px; height: 348px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 18:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658400#M9477</guid>
      <dc:creator>PolashBanerjee</dc:creator>
      <dc:date>2016-09-09T18:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty in executing code in Raster Calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658401#M9478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At first glance, I suspect the issue is the use of parenthesis.&amp;nbsp; Just an educated guess - wouldn't there be parenthesis at the end of the parameters for each CON statement instead of a pile of them at the end?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Con("LULCyear2005_2006_500m_Raster" == 1 &amp;amp; "soilRaster_reclass" == 1 &amp;amp; "slope_reclass" == 1, 0.5&lt;STRONG style="color: #ff0000;"&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/con-.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/con-.htm"&gt;Con—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/guide-books/extensions/spatial-analyst/map-algebra/building-complex-statements.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/guide-books/extensions/spatial-analyst/map-algebra/building-complex-statements.htm"&gt;Building complex statements—ArcGIS Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Chris Donohue, GISP&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 19:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658401#M9478</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2016-09-09T19:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty in executing code in Raster Calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658402#M9479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;It &lt;EM&gt;is&lt;/EM&gt; to do with parentheses, but in the sense that you need them to delineate consecutive Boolean expressions. From your link:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;When using multiple Boolean (&lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/boolean-not-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;~&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/boolean-and-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;amp;&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/boolean-xor-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;^&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;,&lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/boolean-or-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt; |&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;) and/or Relational (&lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/relational-less-than-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;lt;&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/relational-less-than-equal-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;lt;=&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/relational-greater-than-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;gt;&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/relational-greater-than-equal-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;&amp;gt;=&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/relational-equal-to-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;==&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;, &lt;/SPAN&gt;&lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-spatial-analyst/relational-not-equal-operator.htm" style="color: #007ac2; background-color: #fefefe;" rel="nofollow noopener noreferrer" target="_blank"&gt;!=&lt;/A&gt;&lt;SPAN style="color: #4d4d4d; background-color: #fefefe;"&gt;) operators consecutively in a single expression, parentheses should be used. For example, parentheses are required in the following expression (a&amp;gt;2) &amp;amp; (a&amp;lt;5).&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="" style="color: #4d4d4d; background-color: #fefefe; padding-bottom: 75px;"&gt;&lt;DIV class=""&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;outRas&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;Raster&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;"a"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="" style="color: #666666;"&gt;2&lt;/SPAN&gt; &lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class=""&gt;(&lt;/SPAN&gt; &lt;SPAN class=""&gt;Raster&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #a31515;"&gt;"a"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN class="" style="color: #666666;"&gt;5&lt;/SPAN&gt;&lt;SPAN class=""&gt;)

&lt;SPAN style="color: #3d3d3d; background-color: #ffffff;"&gt;So:
Con(("LULCyear2005_2006_500m_Raster" == 1) &amp;amp; ("soilRaster_reclass" == 1) &amp;amp; ("slope_reclass" == 1), 0.5, ...&lt;/SPAN&gt;
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658402#M9479</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-12T03:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty in executing code in Raster Calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658403#M9480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try putting the parentheses around the statements involving "=="&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; color: #3d3d3d; background: white;"&gt;&lt;EM&gt;Con(&lt;STRONG&gt;(&lt;/STRONG&gt;"LULCyear2005_2006_500m_Raster" == 1&lt;STRONG&gt;)&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;(&lt;/STRONG&gt;"soilRaster_reclass" == 1&lt;STRONG&gt;)&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;(&lt;/STRONG&gt;"slope_reclass" == 1&lt;STRONG&gt;)&lt;/STRONG&gt;, 0.5, Con(&lt;STRONG&gt;(&lt;/STRONG&gt;"LULCyear2005_2006_500m_Raster" == 1&lt;STRONG&gt;)&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;(&lt;/STRONG&gt;"soilRaster_reclass" == 1&lt;STRONG&gt;)&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;(&lt;/STRONG&gt;"slope_reclass" == 2&lt;STRONG&gt;)&lt;/STRONG&gt;, 0.55&lt;/EM&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 19:58:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658403#M9480</guid>
      <dc:creator>JayantaPoddar</dc:creator>
      <dc:date>2016-09-09T19:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty in executing code in Raster Calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658404#M9481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another idea - did the output raster assignment assignment get missed?&amp;nbsp; Or is it there but did not get copied over into your example?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;EM&gt;&lt;SPAN class=""&gt;
Using the Con tool in Map&lt;/SPAN&gt;&lt;SPAN class=""&gt; Algebra&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class=""&gt;
&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Conditional_evaluation_with_Con/009z00000008000000/" title="http://resources.arcgis.com/en/help/main/10.1/index.html#/Conditional_evaluation_with_Con/009z00000008000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Help 10.1&lt;/A&gt;&amp;nbsp;
Format:
&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;OutRas&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;&lt;SPAN style="color: #ff0000;"&gt; =&lt;/SPAN&gt; Con (in_conditional_raster, in_true_raster_or_constant, {in_false_raster_or_constant}, {where_clause})
Example:
OutRas&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;Con&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;SlopeRas&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;10&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;"VALUE &amp;lt; 15"&lt;/SPAN&gt;&lt;SPAN class=""&gt;)


&lt;/SPAN&gt;&lt;/EM&gt;Chris Donohue, GISP

EDIT - looks like Darren and Jayanta likely have found the root cause while I was typing this.&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:44:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658404#M9481</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2021-12-12T16:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Difficulty in executing code in Raster Calculator</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658405#M9482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;A &amp;nbsp;Combine followed by a reclass is useful to avoid such ugly and error prone expressions... for next time&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/combine.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/spatial-analyst-toolbox/combine.htm"&gt;Combine—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 20:23:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/difficulty-in-executing-code-in-raster-calculator/m-p/658405#M9482</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-09-09T20:23:07Z</dc:date>
    </item>
  </channel>
</rss>

