<?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: Just trying to do some map algebra, but get extent and cellsize errors. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339198#M26577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;cellSize not Cellsize&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000001s000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000001s000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Nov 2011 21:12:28 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2011-11-01T21:12:28Z</dc:date>
    <item>
      <title>Just trying to do some map algebra, but get extent and cellsize errors.</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339197#M26576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wanted to generate a few flow accumulation grids for alternative pour point inputs.&amp;nbsp; The docs more map algebra made it seem like it would be simple to do this in the python window.&amp;nbsp; But I can't get my env set up correctly.&amp;nbsp; Why isn't easy like: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/32283-set-extent"&gt;http://forums.arcgis.com/threads/32283-set-extent&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been trying stuff like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy.sa import *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = "c:/avdata/topsim/utm/accumtest"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.cellSize = 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# env.extent = "c:/avdata/topsim/utm/accumtest/accum"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument("CURRENT")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.cellSize = 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd,mxd.activeView)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.extent = df[0].extent&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;accum9M = Con("accum"&amp;gt;9000000,1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but when the line setting the extent to an existing file env.extent = "c:/avdata/topsim/utm/accumtest/accum" was followed by the map algebra line, ArcMap 10, sp3, crashed hard to the "ArcMap has encountered a serious problem" reporting window.&amp;nbsp; So I tried to set it to the extent of the current dataframe, lines 7,9,10. But only get a "No CellSize and Extent set" run time error.&amp;nbsp; But when I try to print out the extent, it looks valid, and the cellSize seems to be set to MAXOF. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;IMG src="http://ykfp.org/topsim/pythonerror.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 20:05:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339197#M26576</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2011-11-01T20:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Just trying to do some map algebra, but get extent and cellsize errors.</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339198#M26577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;cellSize not Cellsize&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000001s000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000001s000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 21:12:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339198#M26577</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-11-01T21:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Just trying to do some map algebra, but get extent and cellsize errors.</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339199#M26578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a difference? Both cellSize and Cellsize are in the env. autocomplete. But after setting cellSize = 10,&amp;nbsp; Cellsize also was found to be set to 10.&amp;nbsp; But when I tried to run "accum9M = Con("accum"&amp;gt;9000000,1)" again, python tried, then I got back to: &lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://ykfp.org/topsim/applicationerror.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 21:48:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339199#M26578</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2011-11-01T21:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Just trying to do some map algebra, but get extent and cellsize errors.</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339200#M26579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What did the error report say?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, check your Con statement syntax for your access environment&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000005000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000005000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2011 22:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339200#M26579</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-11-01T22:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Just trying to do some map algebra, but get extent and cellsize errors.</title>
      <link>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339201#M26580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Now I see in the docs for con that there are two different syntax constructions for con, one with a where clause and one without, but the one without a where clause requires the Raster function. And this is different than in other map algebra environments. I tried the line in python without Raster, and I got ArcMap to crash again.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if I set the input to a variable name I don't need to enclose it in quotes again:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; accum = "accum"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; accum9M = Con(Raster(accum) &amp;gt; 9000000, 1, 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This ran to completion, creating a new accumulation raster, with values set to 1 for true and 0 for false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I tried it without the false condition:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;accum10M = Con(Raster(accum) &amp;gt; 10000000, 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This ran, creating a raster with only the data that tested true, the rest nodata.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was also confusing to me that even though I had set the env.workspace, these new rasters were written to some default directory until I added a save line like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;accum9M.save("c:/avdata/topsim/utm/accumtest/accum9M")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 16:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/just-trying-to-do-some-map-algebra-but-get-extent/m-p/339201#M26580</guid>
      <dc:creator>PaulHuffman</dc:creator>
      <dc:date>2011-11-02T16:59:59Z</dc:date>
    </item>
  </channel>
</rss>

