<?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 Extract by Mask generating on-disk output raster (?) in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/extract-by-mask-generating-on-disk-output-raster/m-p/672404#M38095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi folks.&amp;nbsp; I am using desktop 10.0.&amp;nbsp; I'm trying to improve some performance issues and Extract By Mask is a major choke point.&amp;nbsp; Running the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.scratchWorkspace = "in_memory"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RasterSelection = arcpy.sa.ExtractByMask(infile, inmask)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;produces the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ExecuteError: ERROR 010302: Unable to create the output raster: in_memory\Extract_Dec_1
ERROR 010067: Error in executing grid expression.
Failed to execute (ExtractByMask).&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the workspace is left empty (uses defaults) or is set to the gdb that the original raster is in, then it completes successfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something in my setup that is making it do this?&amp;nbsp; I thought ExtractByMask was supposed to generate an in_memory raster regardless.&amp;nbsp; Why would it write to the scratch workspace at all?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not a raster expert by any means.&amp;nbsp; I do try to use objects rather than on-disk references as much as possible.&amp;nbsp; I also just leave the raster format to its default and place them in GDBs, which organizes the file system in a way that works for our group.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:23:23 GMT</pubDate>
    <dc:creator>PaulSimpson</dc:creator>
    <dc:date>2021-12-12T04:23:23Z</dc:date>
    <item>
      <title>Extract by Mask generating on-disk output raster (?)</title>
      <link>https://community.esri.com/t5/data-management-questions/extract-by-mask-generating-on-disk-output-raster/m-p/672404#M38095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi folks.&amp;nbsp; I am using desktop 10.0.&amp;nbsp; I'm trying to improve some performance issues and Extract By Mask is a major choke point.&amp;nbsp; Running the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.scratchWorkspace = "in_memory"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RasterSelection = arcpy.sa.ExtractByMask(infile, inmask)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;produces the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ExecuteError: ERROR 010302: Unable to create the output raster: in_memory\Extract_Dec_1
ERROR 010067: Error in executing grid expression.
Failed to execute (ExtractByMask).&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the workspace is left empty (uses defaults) or is set to the gdb that the original raster is in, then it completes successfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there something in my setup that is making it do this?&amp;nbsp; I thought ExtractByMask was supposed to generate an in_memory raster regardless.&amp;nbsp; Why would it write to the scratch workspace at all?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not a raster expert by any means.&amp;nbsp; I do try to use objects rather than on-disk references as much as possible.&amp;nbsp; I also just leave the raster format to its default and place them in GDBs, which organizes the file system in a way that works for our group.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Paul&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:23:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extract-by-mask-generating-on-disk-output-raster/m-p/672404#M38095</guid>
      <dc:creator>PaulSimpson</dc:creator>
      <dc:date>2021-12-12T04:23:23Z</dc:date>
    </item>
  </channel>
</rss>

