<?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 Exception in ArcEngine 10.1 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334093#M8718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No we couldn't get the raster calculator to work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We worked around the issue by using other raster processing tools (Con, Int, Plus, Minus, Times, Divide, IsNull, etc.) in series.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Niro&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jan 2014 13:29:26 GMT</pubDate>
    <dc:creator>niroshanshan</dc:creator>
    <dc:date>2014-01-23T13:29:26Z</dc:date>
    <item>
      <title>Raster Calculator Exception in ArcEngine 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334090#M8715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We just upgraded from ArcEngine 10 to 10.1 and now the raster calculator does not seem to work anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenever I execute the geoprocesing tool, we get a LoaderLock was detected error and we are unable to continue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I turn off the Loader Lock exception in Visual Studio, it get's a bit further and the application throws a&amp;nbsp; C++ Runtime Error R6034 (Application has made an attempt to load the C run time library incorrectly).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I check the geoprocessing message logs I see a ERROR 000539: Runtime error (AttributeError: 'geoprocessing sys.stdout object' object has no attribute 'write')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to run the same thing in ArcMap's Raster Calculator it works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea what going on? Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Niro&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the following code to execute the raster calculator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;String expression = @"'C:\Temp\RasterCalc\dem_pre' * 10";
String outputPath = @"C:\Temp\FloodPlain24";
Geoprocessor processor = new Geoprocessor();

RasterCalculator RasterCalc = new RasterCalculator(expression, outputPath);
FileInfo fileInfo = new FileInfo(outputPath);
try
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!fileInfo.Directory.Exists) fileInfo.Directory.Create();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processor.OverwriteOutput = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processor.Execute(RasterCalc, null);
}
catch (Exception ex)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Assert(false, ex.ToString());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Write(GetMessages(processor));
}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The full geoprocessing log is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Executing: RasterCalculator "'C:\Temp\RasterCalc\dem_pre' * 10" C:\Temp\FloodPlain24
Start Time: Wed Apr 03 09:52:45 2013
Raster(r'C:\Temp\RasterCalc\dem_pre') * 10
ERROR 000539: Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "C:\Python27\ArcGIS10.1\Lib\warnings.py", line 29, in _show_warning
&amp;nbsp;&amp;nbsp;&amp;nbsp; file.write(formatwarning(message, category, filename, lineno, line))
AttributeError: 'geoprocessing sys.stdout object' object has no attribute 'write'

Failed to execute (RasterCalculator).
Failed at Wed Apr 03 09:54:26 2013 (Elapsed Time: 1 minutes 41 seconds)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 13:09:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334090#M8715</guid>
      <dc:creator>niroshanshan</dc:creator>
      <dc:date>2013-04-03T13:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator Exception in ArcEngine 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334091#M8716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;We just upgraded from ArcEngine 10 to 10.1 and now the raster calculator does not seem to work anymore.&lt;BR /&gt;&lt;BR /&gt;Whenever I execute the geoprocesing tool, we get a LoaderLock was detected error and we are unable to continue.&lt;BR /&gt;&lt;BR /&gt;If I turn off the Loader Lock exception in Visual Studio, it get's a bit further and the application throws a&amp;nbsp; C++ Runtime Error R6034 (Application has made an attempt to load the C run time library incorrectly).&lt;BR /&gt;&lt;BR /&gt;If I check the geoprocessing message logs I see a ERROR 000539: Runtime error (AttributeError: 'geoprocessing sys.stdout object' object has no attribute 'write')&lt;BR /&gt;&lt;BR /&gt;When I try to run the same thing in ArcMap's Raster Calculator it works fine.&lt;BR /&gt;&lt;BR /&gt;Any idea what going on? Thanks.&lt;BR /&gt;&lt;BR /&gt;Niro&lt;BR /&gt;&lt;BR /&gt;I'm using the following code to execute the raster calculator:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;String expression = @"'C:\Temp\RasterCalc\dem_pre' * 10";
String outputPath = @"C:\Temp\FloodPlain24";
Geoprocessor processor = new Geoprocessor();

RasterCalculator RasterCalc = new RasterCalculator(expression, outputPath);
FileInfo fileInfo = new FileInfo(outputPath);
try
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!fileInfo.Directory.Exists) fileInfo.Directory.Create();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processor.OverwriteOutput = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processor.Execute(RasterCalc, null);
}
catch (Exception ex)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Assert(false, ex.ToString());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Write(GetMessages(processor));
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The full geoprocessing log is as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Executing: RasterCalculator "'C:\Temp\RasterCalc\dem_pre' * 10" C:\Temp\FloodPlain24
Start Time: Wed Apr 03 09:52:45 2013
Raster(r'C:\Temp\RasterCalc\dem_pre') * 10
ERROR 000539: Runtime error 
Traceback (most recent call last):
&amp;nbsp; File "C:\Python27\ArcGIS10.1\Lib\warnings.py", line 29, in _show_warning
&amp;nbsp;&amp;nbsp;&amp;nbsp; file.write(formatwarning(message, category, filename, lineno, line))
AttributeError: 'geoprocessing sys.stdout object' object has no attribute 'write'

Failed to execute (RasterCalculator).
Failed at Wed Apr 03 09:54:26 2013 (Elapsed Time: 1 minutes 41 seconds)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you made this work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually i am struggling with a similar code in VB.NET in 10.1, would really appreciate if you could help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sameer Puppal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334091#M8716</guid>
      <dc:creator>sameerpuppal</dc:creator>
      <dc:date>2021-12-11T15:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator Exception in ArcEngine 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334092#M8717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, did you ever figure this out? I am experiencing the same problem and need to solve this too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philip&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 21:31:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334092#M8717</guid>
      <dc:creator>PhilipBailey</dc:creator>
      <dc:date>2014-01-22T21:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Raster Calculator Exception in ArcEngine 10.1</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334093#M8718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No we couldn't get the raster calculator to work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We worked around the issue by using other raster processing tools (Con, Int, Plus, Minus, Times, Divide, IsNull, etc.) in series.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Niro&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2014 13:29:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/raster-calculator-exception-in-arcengine-10-1/m-p/334093#M8718</guid>
      <dc:creator>niroshanshan</dc:creator>
      <dc:date>2014-01-23T13:29:26Z</dc:date>
    </item>
  </channel>
</rss>

