<?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 ExtractByMask Error in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612915#M34565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ExtractByMask does not work for the following Python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckOutExtension("spatial")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tif = "H:\\Test-20100419\\t.tif"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shp = "H:\\Test-20100419\\A27401_05.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out_raster = "H:\\Test-20100419\\ttt.tif"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out = arcpy.sa.ExtractByMask(tif, shp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out.save(out_raster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "H:\Test-20100419\test.py", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out = arcpy.sa.ExtractByMask(tif, shp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Functions.py", line 1210, in ExtractByMask&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_mask_data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Utils.py", line 67, in swapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = wrapper(*args, **kwargs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Functions.py", line 1204, in wrapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\geoprocessing\_base.py", line 438, in &amp;lt;lambda&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000879: Output raster: The length of the stack base name in H:\Test-20100419\Extract_t1 is longer than 9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ExtractByMask).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I set the output raster as a TIF not a Grid Stack, I can not understand the error message "The length of the stack base name is longer than 9." This is not the case. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no any problem when I use ExtractByMask Tool in ArcToolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wentao&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;KKC, Tokyo, Japan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Apr 2010 00:15:10 GMT</pubDate>
    <dc:creator>WentaoChe</dc:creator>
    <dc:date>2010-04-19T00:15:10Z</dc:date>
    <item>
      <title>ExtractByMask Error</title>
      <link>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612915#M34565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ExtractByMask does not work for the following Python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CheckOutExtension("spatial")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tif = "H:\\Test-20100419\\t.tif"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shp = "H:\\Test-20100419\\A27401_05.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out_raster = "H:\\Test-20100419\\ttt.tif"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out = arcpy.sa.ExtractByMask(tif, shp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out.save(out_raster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "H:\Test-20100419\test.py", line 6, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out = arcpy.sa.ExtractByMask(tif, shp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Functions.py", line 1210, in ExtractByMask&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_mask_data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Utils.py", line 67, in swapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = wrapper(*args, **kwargs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Functions.py", line 1204, in wrapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\geoprocessing\_base.py", line 438, in &amp;lt;lambda&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000879: Output raster: The length of the stack base name in H:\Test-20100419\Extract_t1 is longer than 9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ExtractByMask).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I set the output raster as a TIF not a Grid Stack, I can not understand the error message "The length of the stack base name is longer than 9." This is not the case. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is no any problem when I use ExtractByMask Tool in ArcToolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wentao&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;KKC, Tokyo, Japan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 00:15:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612915#M34565</guid>
      <dc:creator>WentaoChe</dc:creator>
      <dc:date>2010-04-19T00:15:10Z</dc:date>
    </item>
    <item>
      <title>ExtractByMask Error</title>
      <link>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612916#M34566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HI Wentao&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There seems to be an issue with the name of the temporary raster that is created by the tool. By default you must have a file based scratch workspace set so the format is attempting to create a grid stack(limit 9 characters).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to set a file geodatabase as your scratch workspace there will not be a name restriction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.scratchWorkspace = "c:/data/myfilegdb.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out = arcpy.sa.ExtractByMask(tif, shp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out.save("C:/output/final_ras")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your input, we will work to remedy the error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Ryan&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI Spatial Analyst Team&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 23:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612916#M34566</guid>
      <dc:creator>RyanDeBruyn</dc:creator>
      <dc:date>2010-04-20T23:17:58Z</dc:date>
    </item>
    <item>
      <title>ExtractByMask Error</title>
      <link>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612917#M34567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Ryan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to set scratch workspace and worksapce to :\Test-20100419\myfilegdb.gdb, both are failed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Herre is the error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "H:\Test-20100419\test2.py", line 19, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out = arcpy.sa.ExtractByMask(tif, shp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Functions.py", line 1210, in ExtractByMask&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_mask_data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Utils.py", line 67, in swapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = wrapper(*args, **kwargs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\sa\Functions.py", line 1204, in wrapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\ArcGIS\Desktop9.4\arcpy\arcpy\geoprocessing\_base.py", line 438, in &amp;lt;lambda&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: ERROR 000875: Output raster: H:\Test-20100419\myfilegdb.gdb\Extract_tif1's workspace is an invalid output workspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000581: Invalid parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ExtractByMask).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wentao&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 00:19:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612917#M34567</guid>
      <dc:creator>WentaoChe</dc:creator>
      <dc:date>2010-04-21T00:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: ExtractByMask Error</title>
      <link>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612918#M34568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This problem persists in Arc10 Build2414.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 20:52:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612918#M34568</guid>
      <dc:creator>PeterProkein</dc:creator>
      <dc:date>2010-10-19T20:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: ExtractByMask Error</title>
      <link>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612919#M34569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For what its worth (a little late to the game from the original post). I'm replying since I also recently received similar error messages when running "Extract By Mask" in a Python script (ArcDesktop 10.3.1). In my particular instance I am referencing a single DEM and selecting multiple polygons to create unique rasters from each polygon. After realizing that a temporary file is created each time the "&lt;SPAN&gt;Extract By Mask"&amp;nbsp;&lt;/SPAN&gt;command is run, executing the save command allowed the passing of a variable with a unique name, eliminating the error messages, allowing the script to create the intended output(s). I also specified a scratch workspace.&lt;/P&gt;&lt;P&gt;script Example:&lt;/P&gt;&lt;P&gt;env.workspace = "//w63-atlas/Stormwater/Waterways/Structure Flood Severity"&lt;/P&gt;&lt;P&gt;bslash = "\\"&lt;BR /&gt;Raster = bslash+"\\w63-atlas\Stormwater\AMEC\CLAY\TOPO\DEM\claydem.gdb\claydem"&lt;/P&gt;&lt;P&gt;arcpy.env.scratchWorkspace = "//w63-atlas/Stormwater/Waterways/Rasterdatasets.gdb"&lt;/P&gt;&lt;P&gt;tile = raw_input("Enter FEMA TILE : C4, C5, C6, D4, D5, D6, E5, E6, F5, F6, G5, or G6: ")&lt;/P&gt;&lt;P&gt;prefix = "Export_"&lt;BR /&gt;suffix = "_Culv*_1.shp"&lt;BR /&gt;depiwant = prefix+tile+suffix&lt;/P&gt;&lt;P&gt;fcList &amp;nbsp;= arcpy.ListFeatureClasses(depiwant)&lt;/P&gt;&lt;P&gt;arcpy.AddMessage(Raster)&lt;BR /&gt;for i in fcList:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Culvnum = i[14:-4]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;rasnew = gdb+"/"+tile+"rz"+Culvnum[:-2]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;outExtractByMask = ExtractByMask(Raster,i)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;arcpy.AddMessage(outExtractByMask)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;outExtractByMask.save(rasnew)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;exit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 15:03:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/extractbymask-error/m-p/612919#M34569</guid>
      <dc:creator>MichaelRichey</dc:creator>
      <dc:date>2017-10-12T15:03:21Z</dc:date>
    </item>
  </channel>
</rss>

