Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

arcpy.sa.Sample() Spatial Analyst "Sample" method

$
0
0
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(). 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.

Please highlight the obvious thing I am missing here.

This succeeds if FGDB is on disk:
Code:


ws_output = r'\\NetworkPath\GDB\Conc2.gdb'
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

This fails:

Code:


outelevtab = "in_memory"
elevrasname = "tabElev"
outelevtab = ws_output + "\\" + elevrasname
arcpy.sa.Sample(rasters, transect_in, outelevtab)

Fails with:
"\\mypath\asc2raster.py", line 700, in extract_raster_values
arcpy.sa.Sample(rasters, transect_in, r'in_memory\tabElev')
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Functions.py", line 1350, in Sample
resampling_type)
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Utils.py", line 47, in swapper
result = wrapper(*args, **kwargs)
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\sa\Functions.py", line 1344, in wrapper
resampling_type)
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\geoprocessing\_base.py", line 498, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 999999: Error executing function.

Viewing all articles
Browse latest Browse all 2485

Trending Articles