<?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: Single Output Map Algebra - Error 010394 - Python in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/single-output-map-algebra-error-010394-python/m-p/188625#M6443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whoops. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Firstly, "divide" is '/' not '\' . Also, there are some escape sequences in the raster names. This necessitates "\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jun 2010 03:35:25 GMT</pubDate>
    <dc:creator>MichaelJust</dc:creator>
    <dc:date>2010-06-03T03:35:25Z</dc:date>
    <item>
      <title>Single Output Map Algebra - Error 010394 - Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/single-output-map-algebra-error-010394-python/m-p/188624#M6442</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;SPAN&gt;I try the code below I get the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Executing: SingleOutputMapAlgebra ((I:\giswork\mattandpeter\MD_ansense_001 + I:\&lt;BR /&gt;giswork\mattandpeter\MD_ansense_002 + I:\giswork\mattandpeter\MD_ansense_003) \&lt;BR /&gt;3) I:\giswork\mattandpeter\MDE_001test #&lt;BR /&gt;Start Time: Wed Jun 02 10:59:15 2010&lt;BR /&gt;Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 010394: Map Algebra expression: Syntax error at location 1 (around (I:\g)&lt;BR /&gt;of expression ((I:\giswork\mattandpeter\MD_ansense_001 + I:\giswork\mattandpeter&lt;BR /&gt;\MD_ansense_002 + I:\giswork\mattandpeter\MD_ansense_003) \ 3).&lt;BR /&gt;Failed to execute (SingleOutputMapAlgebra).&lt;BR /&gt;End Time: Wed Jun 02 10:59:15 2010 (Elapsed Time: 0.00 seconds)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, this command works fine in Raster Calculator.&amp;nbsp; I don' t know what's wrong with my syntax for SOMA.&amp;nbsp; I've tried forward and back slashes.&amp;nbsp; Any ideas on how I can get this to work? Or why its not working?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcgisscripting
from datetime import datetime 
# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Set local variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("\n" + "Begin Calculating" + "\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp; InExpression = "((I:\giswork\mattandpeter\MD_anse\anse_001 + I:\giswork\mattandpeter\MD_anse\anse_002 + I:\giswork\mattandpeter\MD_anse\anse_003) \ 3)"
&amp;nbsp;&amp;nbsp;&amp;nbsp; OutRaster = "I:\giswork\mattandpeter\MDE_001test"
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage(str(datetime.now()))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Check out Spatial Analyst extension license
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CheckOutExtension("Spatial")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: MapAlgebraStatement
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.SingleOutputMapAlgebra_sa(InExpression, OutRaster)
&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage(str(datetime.now()))

except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # If an error occurred while running a tool, then print the messages.
&amp;nbsp;&amp;nbsp;&amp;nbsp; print gp.GetMessages()
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:31:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/single-output-map-algebra-error-010394-python/m-p/188624#M6442</guid>
      <dc:creator>MichaelJust</dc:creator>
      <dc:date>2021-12-11T09:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Single Output Map Algebra - Error 010394 - Python</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/single-output-map-algebra-error-010394-python/m-p/188625#M6443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Whoops. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Firstly, "divide" is '/' not '\' . Also, there are some escape sequences in the raster names. This necessitates "\\"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Michael&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jun 2010 03:35:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/single-output-map-algebra-error-010394-python/m-p/188625#M6443</guid>
      <dc:creator>MichaelJust</dc:creator>
      <dc:date>2010-06-03T03:35:25Z</dc:date>
    </item>
  </channel>
</rss>

