<?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 Python: raster output to in-memory Error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638516#M49790</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I crossed a very headache issue.&amp;nbsp; The same code run &lt;STRONG&gt;successful&lt;/STRONG&gt; in&amp;nbsp; ArcMap Python built-in Window&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "\\in-memory"&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; CurRas0 = Con(image,0,1,"Value = 0")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I &lt;STRONG&gt;could not make it run&lt;/STRONG&gt; from the Python IDLE, both IDLEs for 2.7.5 (ArcMap 10.2.2) and for 3.6.8 (ArcPro 2.3):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "\\in-memory"&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; CurRas0 = Con(image,0,1,"Value = 0")&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;pyshell#4&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt; CurRas0 = Con(image,0,1,"Value = 0")&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 271, in Con&lt;BR /&gt; where_clause)&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 53, in swapper&lt;BR /&gt; result = wrapper(*args, **kwargs)&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 265, in Wrapper&lt;BR /&gt; where_clause)&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in &amp;lt;lambda&amp;gt;&lt;BR /&gt; return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 000875: Output raster: \in-memory\Con_Central_KIN1.tif's workspace is an invalid output workspace.&lt;BR /&gt;ERROR 000581: Invalid parameters.&lt;BR /&gt;Failed to execute (Con).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It keeps saying the workspace is invalid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone please shade me some lights on this? Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Feb 2020 03:21:43 GMT</pubDate>
    <dc:creator>LanNguyen1</dc:creator>
    <dc:date>2020-02-26T03:21:43Z</dc:date>
    <item>
      <title>Python: raster output to in-memory Error</title>
      <link>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638516#M49790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I crossed a very headache issue.&amp;nbsp; The same code run &lt;STRONG&gt;successful&lt;/STRONG&gt; in&amp;nbsp; ArcMap Python built-in Window&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "\\in-memory"&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; CurRas0 = Con(image,0,1,"Value = 0")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I &lt;STRONG&gt;could not make it run&lt;/STRONG&gt; from the Python IDLE, both IDLEs for 2.7.5 (ArcMap 10.2.2) and for 3.6.8 (ArcPro 2.3):&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; arcpy.env.workspace = "\\in-memory"&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; CurRas0 = Con(image,0,1,"Value = 0")&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;pyshell#4&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt; CurRas0 = Con(image,0,1,"Value = 0")&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 271, in Con&lt;BR /&gt; where_clause)&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Utils.py", line 53, in swapper&lt;BR /&gt; result = wrapper(*args, **kwargs)&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\sa\Functions.py", line 265, in Wrapper&lt;BR /&gt; where_clause)&lt;BR /&gt; File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in &amp;lt;lambda&amp;gt;&lt;BR /&gt; return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: ERROR 000875: Output raster: \in-memory\Con_Central_KIN1.tif's workspace is an invalid output workspace.&lt;BR /&gt;ERROR 000581: Invalid parameters.&lt;BR /&gt;Failed to execute (Con).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It keeps saying the workspace is invalid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone please shade me some lights on this? Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 03:21:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638516#M49790</guid>
      <dc:creator>LanNguyen1</dc:creator>
      <dc:date>2020-02-26T03:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python: raster output to in-memory Error</title>
      <link>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638517#M49791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-01176-01200-001200.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/tool-errors-and-warnings/001001-010000/tool-errors-and-warnings-01176-01200-001200.htm"&gt;001200: Raster output to an in-memory workspace is not supported.—Help | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm" title="https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/basics/the-in-memory-workspace.htm"&gt;Write geoprocessing output to memory—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is legacy,&amp;nbsp;but it is denoted as&lt;STRONG&gt;&amp;nbsp;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;in_memory&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&amp;nbsp;with the underscore&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;The new &lt;STRONG&gt;memory&lt;/STRONG&gt; workspace supports rasters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Too many memories&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 04:42:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638517#M49791</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-02-26T04:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python: raster output to in-memory Error</title>
      <link>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638518#M49792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Big thank to Dan!,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;God, I did have "in_memory" everywhere in the code. Just could not justify why I used "in-memory" in that section of codes. ANd interestingly it worked in Python window 10.2.2 &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeah, my main script now works much faster directly with the "in_memory" instead of reaching out to the SDE in the previous version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other question to DAN: It did not work when I point arcpy.env.workspace to the default.gdb in my local C:&lt;/P&gt;&lt;P&gt;Got the same invalid workspace error as in my question.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2020 06:06:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-raster-output-to-in-memory-error/m-p/638518#M49792</guid>
      <dc:creator>LanNguyen1</dc:creator>
      <dc:date>2020-02-26T06:06:14Z</dc:date>
    </item>
  </channel>
</rss>

