<?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: format MEM? can not save temporary raster? RuntimeError: ERROR 010240: in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295941#M22868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I am working with a large number of temporary rasters. Individually they can be saved simply and without issue like&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;r1.save(outloc)&lt;/PRE&gt; &lt;BR /&gt;However, if they are combined in any way -e.g.&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;x = &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Raster(r1) + Raster(r2)&lt;/SPAN&gt;&lt;/PRE&gt; &lt;BR /&gt;and the result saved&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;x.save(outloc)&lt;/PRE&gt; &lt;BR /&gt;I receive the following error&amp;nbsp; &lt;BR /&gt;"RuntimeError: ERROR 010240: Could not save raster dataset to in_memory\times_ras1 with output format MEM."&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;If I save -all- the temporary rasters before they are combined the final rasters save without issue.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Any thoughts?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What does print outloc give you?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Might try the change in red and see if that fixes it for you. (documentation is unclear, you might need arcpy.env.workspace set an use quotes around r1 and r2. You will have to test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000051000000" rel="nofollow"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000051000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Jul 2013 22:42:03 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2013-07-24T22:42:03Z</dc:date>
    <item>
      <title>format MEM? can not save temporary raster? RuntimeError: ERROR 010240:</title>
      <link>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295939#M22866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am working with a large number of temporary rasters.&amp;nbsp; Individually they can be saved simply and without issue like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;r1.save(outloc)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if they are combined in any way -e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;x = r1 + r2&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;and the result saved&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;x.save(outloc)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;I receive the following error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"RuntimeError: ERROR 010240: Could not save raster dataset to in_memory\times_ras1 with output format MEM."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I save -all- the temporary rasters before they are combined the final rasters save without issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 16:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295939#M22866</guid>
      <dc:creator>AndrewKniowski</dc:creator>
      <dc:date>2013-07-24T16:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: format MEM? can not save temporary raster? RuntimeError: ERROR 010240:</title>
      <link>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295940#M22867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It may be that the raster objects do not support being added together with the plus symbol, "+".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Might be good to read the documentation, there is probably a command like (just making this up) &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;x=arcpy.CombineRasters(r1, r2)&lt;/SPAN&gt;&lt;SPAN&gt;. You could check what is going on with something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.AddMessage(str(r1))
arcpy.AddMessage(str(r2))
x = r1 + r2
arcpy.AddMessage(str(x))&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If adding &lt;/SPAN&gt;&lt;STRONG style="font-style: italic;"&gt;is&lt;/STRONG&gt;&lt;SPAN&gt; supported then you will get something the following output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;arcpy.Raster object at kd985ujgs&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;arcpy.Raster object at gj3429gjk&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;arcpy.Raster object at v92jnb92m&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it isn't supported the third entry will be different.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:12:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295940#M22867</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2021-12-11T14:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: format MEM? can not save temporary raster? RuntimeError: ERROR 010240:</title>
      <link>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295941#M22868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I am working with a large number of temporary rasters. Individually they can be saved simply and without issue like&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;r1.save(outloc)&lt;/PRE&gt; &lt;BR /&gt;However, if they are combined in any way -e.g.&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;x = &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Raster(r1) + Raster(r2)&lt;/SPAN&gt;&lt;/PRE&gt; &lt;BR /&gt;and the result saved&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;x.save(outloc)&lt;/PRE&gt; &lt;BR /&gt;I receive the following error&amp;nbsp; &lt;BR /&gt;"RuntimeError: ERROR 010240: Could not save raster dataset to in_memory\times_ras1 with output format MEM."&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;If I save -all- the temporary rasters before they are combined the final rasters save without issue.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Any thoughts?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What does print outloc give you?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Might try the change in red and see if that fixes it for you. (documentation is unclear, you might need arcpy.env.workspace set an use quotes around r1 and r2. You will have to test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000051000000" rel="nofollow"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000051000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 22:42:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295941#M22868</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-07-24T22:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: format MEM? can not save temporary raster? RuntimeError: ERROR 010240:</title>
      <link>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295942#M22869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I originally had the env.workspace set to "in_memory" to speed up processing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After changing it to a physical location the script seems to work without issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still unclear as to what the issue is however.&amp;nbsp; The same general function sequence has worked fine for me in other contexts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 19:34:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295942#M22869</guid>
      <dc:creator>AndrewKniowski</dc:creator>
      <dc:date>2013-07-25T19:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: format MEM? can not save temporary raster? RuntimeError: ERROR 010240:</title>
      <link>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295943#M22870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have this same problem. &amp;nbsp;Lots of rasters using in_memory. &amp;nbsp;I have even used&amp;nbsp;arcpy.Delete_management to remove them when i am done, but I still get this error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 May 2017 19:14:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/format-mem-can-not-save-temporary-raster/m-p/295943#M22870</guid>
      <dc:creator>RustyRex</dc:creator>
      <dc:date>2017-05-11T19:14:46Z</dc:date>
    </item>
  </channel>
</rss>

