AnsweredAssumed Answered

Cant get ArcGIS 10.3.1 “topo to raster” to work in python script

Question asked by thaelom on Aug 15, 2016
Latest reply on Aug 15, 2016 by xander_bakker

I copied the sample python script from this webpage and modified for my own data and paths.


Topo to Raster—Help | ArcGIS for Desktop 


# Name:
# Description: Interpolates a hydrologically correct surface
#    from point, line, and polygon data.
# Requirements: Spatial Analyst Extension

# testing topo to raster gcr

# Import system modules
import arcpy
from arcpy import env
from import *

# Set environment settings
env.workspace = "D:/clovis_portales/cp_spatial/hydrology/water_level_analysis_v7_py"

# Set local variables
##inPointElevations = TopoPointElevation(['wells_in.shp', 'usgs_wl'])

inContours = TopoContour(['rwl_krg_cntr_smth.shp', 'CONTOUR'])

# Check out the ArcGIS Spatial Analyst extension license

# Execute TopoToRaster
outTTR = TopoToRaster(inContours)

### Save the output"D:/clovis_portales/cp_spatial/hydrology/water_level_analysis_v7_py/ttrout03")

I keep getting the following errors:

Traceback (most recent call last):
  File "D:\clovis_portales\cp_spatial\hydrology\water_level_analysis_v7_py\", line 25, in <module>
    outTTR = TopoToRaster(inContours)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\", line 2777, in TopoToRaster
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\", line 53, in swapper
    result = wrapper(*args, **kwargs)
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\sa\", line 2753, in Wrapper
  File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\geoprocessing\", line 504, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
RuntimeError: Object: Error in executing tool

It doesnt work with point or contour data. Topo to raster works fine with same data and paths when using the GUI in arc toolbox


thanks in advance for any help