Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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"
share|improve this question
    
Did you check the return value of arcpy.CheckOutExtension("3D") to make sure it is Available?. –  mhoran_psprep Jul 20 '12 at 14:15
add comment

1 Answer 1

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.

share|improve this answer
    
Thank you Cyrus. That really was the problem. Seems like I overlooked it –  Simmal Jul 24 '12 at 8:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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