<?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 arcpy.sa.Sample() Spatial Analyst &amp;amp;quot;Sample&amp;amp;quot; method in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263136#M20284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Devloping an implementation that will build a GDB table from the raster cell values of a series of input raster datasets using the sa.Sample().&amp;nbsp; It works exactly as intended when I specify the output table to a File Geodatabase on disk but it fails if I try to write this table to the in_memory space.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please highlight the obvious thing I am missing here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This succeeds if FGDB is on disk:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

ws_output = r'\\NetworkPath\GDB\Conc2.gdb'
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This fails:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

outelevtab = "in_memory"
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fails with: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"\\mypath\asc2raster.py", line 700, in extract_raster_values&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.sa.Sample(rasters, transect_in, r'in_memory\tabElev')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Functions.py", line 1350, in Sample&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resampling_type)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, 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:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Functions.py", line 1344, in wrapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resampling_type)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 498, 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, True))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Dec 2013 16:20:02 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2013-12-10T16:20:02Z</dc:date>
    <item>
      <title>arcpy.sa.Sample() Spatial Analyst &amp;quot;Sample&amp;quot; method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263136#M20284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Devloping an implementation that will build a GDB table from the raster cell values of a series of input raster datasets using the sa.Sample().&amp;nbsp; It works exactly as intended when I specify the output table to a File Geodatabase on disk but it fails if I try to write this table to the in_memory space.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please highlight the obvious thing I am missing here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This succeeds if FGDB is on disk:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

ws_output = r'\\NetworkPath\GDB\Conc2.gdb'
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This fails:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

outelevtab = "in_memory"
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fails with: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"\\mypath\asc2raster.py", line 700, in extract_raster_values&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.sa.Sample(rasters, transect_in, r'in_memory\tabElev')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Functions.py", line 1350, in Sample&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resampling_type)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, 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:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Functions.py", line 1344, in wrapper&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resampling_type)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 498, 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, True))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 999999: Error executing function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 16:20:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263136#M20284</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2013-12-10T16:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263137#M20285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;This succeeds if FGDB is on disk:&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

ws_output = r'\\NetworkPath\GDB\Conc2.gdb'
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;This fails:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

outelevtab = "in_memory"
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in your second bit of code, outelevtype is being assigned twice and there is no assignment for ws_output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So perhaps that second bit should be...&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

&lt;STRONG&gt;ws_output &lt;/STRONG&gt;= "in_memory"
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also find it is better to use that os.path.join(var1, var2) construct to piece variables together to make paths.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:54:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263137#M20285</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-11T12:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263138#M20286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply, Neil.&amp;nbsp; That was an oversight on my part in my haste to post up the problem code.&amp;nbsp; It definitely appears that the output of sa.Sample cannot be set to the in_memory space --- can you or anyone confirm this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All of these fail with the same ERROR 999999:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
elevrasname = "tabElev"
ws_inmem = "in_memory"
outelevtab = ws_inmem + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outelevtab = "in_memory\\tabElev"
arcpy.sa.Sample(rasters, transect_in, outelevtab)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
outelevtab =&amp;nbsp; r'in_memory\tabElev'
arcpy.sa.Sample(rasters, transect_in, outelevtab)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
arcpy.sa.Sample(rasters, transect_in, "in_memory\\tabElev")
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the os.path.join idea.&amp;nbsp; I will get that into my py lexicon more!&amp;nbsp; Unfortunately it has the same error 999999:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
elevrasname = "tabElev"
ws_inmem = "in_memory"
outelevtab = os.path.join(ws_inmem, elevrasname)
arcpy.sa.Sample(rasters, transect_in, outelevtab)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This succeeds:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
elevrasname = "tabElev"
ws_output = r'\\NetworkPath\GDB\Conc.gdb'
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:54:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263138#M20286</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T12:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263139#M20287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sample is a really old tool that dates back to ArcInfo Workstation GRID. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you tried Extract Values To Points or Extract Multi-Values To Points instead? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My guess is the newer tools may play nicer with the in_memory workspace.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tend to reserve the in_memory workspace for things that I know will be very small datasets, to make sure I don't bollux up my RAM if I am not successful in cleaning up scratch data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the new scratchGDB environment (guaranteed writable scratch location) it's a lot easier to implement scratch files on disk, and file GDB is pretty fast.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 15:50:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263139#M20287</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-12-11T15:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263140#M20288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Sample is a really old tool that dates back to ArcInfo Workstation GRID. &lt;BR /&gt;&lt;BR /&gt;Have you tried Extract Values To Points or Extract Multi-Values To Points instead? &lt;BR /&gt;&lt;BR /&gt;My guess is the newer tools may play nicer with the in_memory workspace.&lt;BR /&gt;&lt;BR /&gt;I tend to reserve the in_memory workspace for things that I know will be very small datasets, to make sure I don't bollux up my RAM if I am not successful in cleaning up scratch data.&lt;BR /&gt;&lt;BR /&gt;With the new scratchGDB environment (guaranteed writable scratch location) it's a lot easier to implement scratch files on disk, and file GDB is pretty fast.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the input, Curtis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I started this implementation using arcpy.gp.ExtractValuesToTable_ga() but that meant processing individual rasters at a time.&amp;nbsp; So, I looked at the arcpy.sa.Sample() method to allow me to pass in the entire set of rasters in the hopes of gaining some performance --- and I did!&amp;nbsp; It takes approx 1/2 the time to process which is huge gains.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So...&amp;nbsp; I hoped to use the in_memory space for even more performance.&amp;nbsp; Since the output of this is a table, I wasn't completely worried about filling up the RAM --- I make sure to remove intermediate results/outputs as quickly as possible.&amp;nbsp; That output converts quickly to a numpy array (arcpy.da.TableToNumPyArray) for additional processing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My experience with in_memory has been good and I tend to look for opportunities to use it as much as I can BUT now you are making me question that if you worry about unsuccessful cleanup!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway -- I will try the other methods you mention.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 18:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263140#M20288</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2013-12-11T18:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263141#M20289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; My experience with in_memory has been good and I tend to look for opportunities to use it as much as I can BUT now you are making me question that if you worry about unsuccessful cleanup!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've had very good experiences with it too, but have seen complaints on the forums (like yours) when in_memory fails on particular tools. One of those trust-but-verify situations -- just warning you to keep your eyes open. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2013 20:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263141#M20289</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-12-11T20:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263142#M20290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tested this code :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# test sa.sample
import sys, os, arcpy
from arcpy import env
from arcpy.sa import *

arcpy.CheckOutExtension("Spatial")

InputFGDB = "c:/Data/ESRI-SA/ArcForums/TestData.gdb"
env.workspace = InputFGDB
RasList = arcpy.ListRasters()
print RasList
inPnts = "SamplePnts"
outTab = "in_memory/sampTbl"

Sample(RasList, inPnts, outTab, "NEAREST")

env.workspace = "in_memory"
tbl = arcpy.ListTables()[0]
recs = arcpy.GetCount_management(tbl).getOutput(0)
print "Table {} records {}".format(tbl, recs)

listFields = arcpy.ListFields(tbl)
for f in listFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print f.name
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which gave me this....&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; 
[u'IP_bi', u'RES_bi']
Table sampTbl records 200
OBJECTID
SamplePnts
X
Y
IP_bi
RES_bi
&amp;gt;&amp;gt;&amp;gt; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So no errors on my side. No answer for you, sorry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263142#M20290</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-11T12:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.sa.Sample() Spatial Analyst "Sample" method</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263143#M20291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;James,&lt;BR /&gt;tested this code :&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# test sa.sample
import sys, os, arcpy
from arcpy import env
from arcpy.sa import *

arcpy.CheckOutExtension("Spatial")

InputFGDB = "c:/Data/ESRI-SA/ArcForums/TestData.gdb"
env.workspace = InputFGDB
RasList = arcpy.ListRasters()
print RasList
inPnts = "SamplePnts"
outTab = "in_memory/sampTbl"

Sample(RasList, inPnts, outTab, "NEAREST")

env.workspace = "in_memory"
tbl = arcpy.ListTables()[0]
recs = arcpy.GetCount_management(tbl).getOutput(0)
print "Table {} records {}".format(tbl, recs)

listFields = arcpy.ListFields(tbl)
for f in listFields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print f.name
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;which gave me this....&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;gt;&amp;gt;&amp;gt; 
[u'IP_bi', u'RES_bi']
Table sampTbl records 200
OBJECTID
SamplePnts
X
Y
IP_bi
RES_bi
&amp;gt;&amp;gt;&amp;gt; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;So no errors on my side. No answer for you, sorry.&lt;BR /&gt;Cheers,&lt;BR /&gt;Neil&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well now that is just entirely frustrating.&amp;nbsp; I copied your simple setup/code, replacing the sources and get the same error I was before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 10.1 SP1 (Build 3143)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Citrix Deployment&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, I ran this from PythonWin as well as a source script executed from a Toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:54:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sa-sample-spatial-analyst-amp-quot-sample/m-p/263143#M20291</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T12:54:12Z</dc:date>
    </item>
  </channel>
</rss>

