<?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: Extract by Attributes error with extract.save in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683660#M52925</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This was basically the same as the script I had, with the addition of the backslash. Mine looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

arcpy.env.workspace = r"S:\FIRE\86to92.gdb"
workspace = arcpy.env.workspace

outtable = r"S:\FIRE\73to80.gdb\y86to92"

for raster in arcpy.ListRasters(): 
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpoint = workspace + "/" + raster + "af"
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.sa.ExtractByAttributes (raster, " VALUE = 6 OR VALUE = 8")
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract.save (outpoint)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, now I am getting this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Traceback (most recent call last):
&amp;nbsp; File "S:\FIRE\gdb.py", line 33, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.sa.ExtractByAttributes (raster, " VALUE = 6 OR VALUE = 8")
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 1117, in ExtractByAttributes
&amp;nbsp;&amp;nbsp;&amp;nbsp; where_clause)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Utils.py", line 47, in swapper
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = wrapper(*args, **kwargs)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 1113, in wrapper
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in &amp;lt;lambda&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))
ExecuteError: ERROR 999999: Error executing function.
Access denied
Access denied [GDB_Items]
No spatial reference exists.
ERROR 010302: Unable to create the output raster: S:\FIRE\86to92.gdb\Extract_u8001
ERROR 010067: Error in executing grid expression.
Failed to execute (ExtractByAttributes).
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 010302 suggests that I don't have write permission or don't have enough space available. I checked and both of these are OK.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:45:19 GMT</pubDate>
    <dc:creator>AnneRiddle</dc:creator>
    <dc:date>2021-12-12T04:45:19Z</dc:date>
    <item>
      <title>Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683658#M52923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;On the following code block (specifically, the last line), IDLE throws this error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 010093: Output raster format UNKNOWN is unsupported.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
for raster in arcpy.ListRasters(): 
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpoint = workspace + raster + "af"
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.sa.ExtractByAttributes (raster, " VALUE = 6 OR VALUE = 8")
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract.save (outpoint)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel like it shouldn't be necessary to specify a format since the output is saving into a geodatabase. Also, is there better documentation on extract.save somewhere? I've found very little on it and am just imitating the syntax example used on the Extract by Attributes tool page.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 19:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683658#M52923</guid>
      <dc:creator>AnneRiddle</dc:creator>
      <dc:date>2012-04-11T19:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683659#M52924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Based on your script I created this one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.CheckOutExtension("Spatial")

workspace = "C:/tmp/Testing.gdb"
arcpy.env.workspace = workspace

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in arcpy.ListRasters():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outpoint = workspace + "/" + raster + "af"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.sa.ExtractByAttributes(raster, "VALUE = 6 OR VALUE = 8")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; extract.save(outpoint)
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.GetMessages()&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Works.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:45:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683659#M52924</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-12T04:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683660#M52925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This was basically the same as the script I had, with the addition of the backslash. Mine looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

arcpy.env.workspace = r"S:\FIRE\86to92.gdb"
workspace = arcpy.env.workspace

outtable = r"S:\FIRE\73to80.gdb\y86to92"

for raster in arcpy.ListRasters(): 
&amp;nbsp;&amp;nbsp;&amp;nbsp; outpoint = workspace + "/" + raster + "af"
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.sa.ExtractByAttributes (raster, " VALUE = 6 OR VALUE = 8")
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract.save (outpoint)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, now I am getting this error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Traceback (most recent call last):
&amp;nbsp; File "S:\FIRE\gdb.py", line 33, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; extract = arcpy.sa.ExtractByAttributes (raster, " VALUE = 6 OR VALUE = 8")
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 1117, in ExtractByAttributes
&amp;nbsp;&amp;nbsp;&amp;nbsp; where_clause)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Utils.py", line 47, in swapper
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = wrapper(*args, **kwargs)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\sa\Functions.py", line 1113, in wrapper
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster)
&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 474, in &amp;lt;lambda&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return lambda *args: val(*gp_fixargs(args))
ExecuteError: ERROR 999999: Error executing function.
Access denied
Access denied [GDB_Items]
No spatial reference exists.
ERROR 010302: Unable to create the output raster: S:\FIRE\86to92.gdb\Extract_u8001
ERROR 010067: Error in executing grid expression.
Failed to execute (ExtractByAttributes).
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 010302 suggests that I don't have write permission or don't have enough space available. I checked and both of these are OK.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:45:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683660#M52925</guid>
      <dc:creator>AnneRiddle</dc:creator>
      <dc:date>2021-12-12T04:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683661#M52926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am getting the same error as the original post on this thread (ERROR 010093). I tried changing my os.sep to "/" but still get the error. My code is below, the error occurs on the FdrOut.save line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for HUC in HUCs:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print HUC
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FDRpath = Main + os.sep + "fdr"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FACpath = Main + os.sep + "fac"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print FDRpath
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print FACpath
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Execute ExtractByMask
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FdrOut = ExtractByMask(MainFdr, HUC)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the output 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FdrOut.save(FDRpath + "/" + "fdr_" + HUC)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "fdr finished"
&amp;nbsp;&amp;nbsp;&amp;nbsp; except:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "error_" + HUC
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; continue&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:45:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683661#M52926</guid>
      <dc:creator>toddsams</dc:creator>
      <dc:date>2021-12-12T04:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683662#M52927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe you shold use "\" instead of "/" in this line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;os &lt;/SPAN&gt;&lt;SPAN&gt;module prowides very convenient method for constructing pathes - &lt;/SPAN&gt;&lt;SPAN style="font-family:Courier New;"&gt;join&lt;/SPAN&gt;&lt;SPAN&gt;. In your case it will be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;outRaster = os.path.join(FDRpath, "fdr_" + "HUC")
FdrOut.save(outRaster)&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The same way you can construct &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;FDRpath &lt;/SPAN&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;FACpath &lt;/SPAN&gt;&lt;SPAN&gt;variables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683662#M52927</guid>
      <dc:creator>MarcinGasior</dc:creator>
      <dc:date>2021-12-12T04:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683663#M52928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A few things to keep in mind:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Although Spatial Analyst tools now do direct read/write of many formats, grid (folder workspace) is usually still the best choice.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;The workspace and scratchWorkspace should be set to the same folder for best performance.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Grid format is limited to 13-characters, alphanumeric + "_", starting with a letter.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Workspace, feature class, table, and field names should never begin with a number.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2012 05:12:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683663#M52928</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-06-06T05:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Extract by Attributes error with extract.save</title>
      <link>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683664#M52929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This error (010093) often occurs when trying to create an improperly named raster file. For GRIDs, the naming restrictions include:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;...a grid should not be named with spaces or any other special characters in its name. A multiple-band grid cannot have more than 9 characters in its file name, and a single-band raster dataset cannot have more than 13 characters.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Todd, this probably applies in your case, if you're using HUC 12s; the appending of your four characters ('fdr_') puts you over the 13 character limit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//009t0000000w000000"&gt;ESRI's help page on GRIDs&lt;/A&gt;&lt;SPAN&gt; for more info.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 17:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-by-attributes-error-with-extract-save/m-p/683664#M52929</guid>
      <dc:creator>ThomasLaxson</dc:creator>
      <dc:date>2013-11-26T17:36:09Z</dc:date>
    </item>
  </channel>
</rss>

