<?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 in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error/m-p/1187885#M11724</link>
    <description>&lt;P&gt;Same problem for me.&lt;/P&gt;&lt;P&gt;Exporting a tool that works well in Model builder to Python and running it as a script produces this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Band_1 = "D:\\tmp\\raster.png\\Band_1"&lt;BR /&gt;Band_2 = "D:\\tmp\\raster.png\\Band_2"&lt;BR /&gt;Band_3 = "D:\\tmp\\raster.png\\Band_3"&lt;/P&gt;&lt;P&gt;# Process: Raster Calculator (Raster Calculator) (ia)&lt;BR /&gt;ap_tmpCon = "D:\\tmp\\lcFromRaster.gdb\\ap_tmpCon"&lt;BR /&gt;Raster_Calculator = ap_tmpCon&lt;BR /&gt;ap_tmpCon = Con((Band_1 == 176) &amp;amp; (Band_2 == 176) &amp;amp; (Band_3 == 176), 1, 0)&lt;BR /&gt;ap_tmpCon .save(Raster_Calculator)&lt;/P&gt;&lt;P&gt;gets me the same error. I assume its a but with the Con function in&amp;nbsp;arcpy.ia .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how to fix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2022 16:13:21 GMT</pubDate>
    <dc:creator>PatrickOswald1</dc:creator>
    <dc:date>2022-06-29T16:13:21Z</dc:date>
    <item>
      <title>Raster Calculator Error</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error/m-p/592746#M8647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am getting an error running raster calculator that I can't figure out. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 2 rasters, narr_grid_Clip and sc_neg15. The first (narr...) has values ranging from 1 to 10. The second (sc...) only has data when the first is equal to 1. The calculation I am trying to run is very long, but repetitive with other layers similar to sc_neg15 that correspond to other values of narr_grid_Clip . I have trimmed it down to just the part dealing with sc_neg15, but the error remains exactly the same. I figure it will be easier to debug the small version, and then apply it to the larger one as a whole. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the simplified calculation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Con("narr_grid_Clip" == 1,"sc_neg15")[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the error messages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]xecuting: RasterCalculator Con("narr_grid_Clip" == 1,"sc_neg15") H:\ajm236.gdb\rastercalc3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Fri May 02 11:07:21 2014&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Con(Raster(r"narr_grid_Clip") == 1,Raster(r"sc_neg15"))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression: rcexec() &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;expression&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "&amp;lt;string&amp;gt;", line 5, in rcexec&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 240, in Con&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where_clause)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, in swapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = wrapper(*args, **kwargs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\sa\Functions.py", line 225, in wrapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _wrapLocalFunctionRaster(u"Con_sa", ["IfThen", in_conditional_raster, in_true_raster_or_constant])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: ERROR 010422: Error in processing the environment mask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (RasterCalculator).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Fri May 02 11:07:24 2014 (Elapsed Time: 3.00 seconds)[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 14:18:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error/m-p/592746#M8647</guid>
      <dc:creator>AndrewMontreuil</dc:creator>
      <dc:date>2014-05-02T14:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator Error</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error/m-p/1187885#M11724</link>
      <description>&lt;P&gt;Same problem for me.&lt;/P&gt;&lt;P&gt;Exporting a tool that works well in Model builder to Python and running it as a script produces this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Band_1 = "D:\\tmp\\raster.png\\Band_1"&lt;BR /&gt;Band_2 = "D:\\tmp\\raster.png\\Band_2"&lt;BR /&gt;Band_3 = "D:\\tmp\\raster.png\\Band_3"&lt;/P&gt;&lt;P&gt;# Process: Raster Calculator (Raster Calculator) (ia)&lt;BR /&gt;ap_tmpCon = "D:\\tmp\\lcFromRaster.gdb\\ap_tmpCon"&lt;BR /&gt;Raster_Calculator = ap_tmpCon&lt;BR /&gt;ap_tmpCon = Con((Band_1 == 176) &amp;amp; (Band_2 == 176) &amp;amp; (Band_3 == 176), 1, 0)&lt;BR /&gt;ap_tmpCon .save(Raster_Calculator)&lt;/P&gt;&lt;P&gt;gets me the same error. I assume its a but with the Con function in&amp;nbsp;arcpy.ia .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how to fix?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 16:13:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-calculator-error/m-p/1187885#M11724</guid>
      <dc:creator>PatrickOswald1</dc:creator>
      <dc:date>2022-06-29T16:13:21Z</dc:date>
    </item>
  </channel>
</rss>

