1

I´m always getting an Error with my Python-Code. Even though it is almost the same as on the ArcGIS Help Website.

The Error occurs in line 19:

Traceback (most recent call last):

File "C:_geodata\check.py", line 19, in

arcpy.RasterDomain_3d(rasterList,out_file,geometry)

File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\ddd.py", line 998, in RasterDomain

raise e RuntimeError: Object: Error in executing tool

Failed to execute (IterateRasterDomain).

My Code looks like this:

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")

env.workspace = arcpy.GetParameterAsText(0)
rasterList = arcpy.ListRasters()

if rasterList:
    for raster in rasterList:
        geometry = "POLYGON"
        out_file = "domain_" + raster[:-4] + ".shp"
        arcpy.RasterDomain_3d(rasterList,out_file,geometry)
    print "Finished"
else:
    print "No Data available"
1
  • Did you check the return value of arcpy.CheckOutExtension("3D") to make sure it is Available?. Commented Jul 20, 2012 at 14:15

1 Answer 1

5

Perhaps "rasterList" should be "raster" in:

arcpy.RasterDomain_3d(rasterList,out_file,geometry)

From the documentation it looks like RasterDomain_3d takes only a raster rather than a list.

1
  • Thank you Cyrus. That really was the problem. Seems like I overlooked it
    – Simmal
    Commented Jul 24, 2012 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.