0

I am having an issue with the Contour (Spatial Analyst) tool in ArcGIS. When I manually run the tool in ArcToolbox, it will sometimes say that the tool has failed, giving the following error message:

ExecuteError: ERROR 010157: Unable to open feature class F:\2014\data\083c15_contour.shp Failed to execute (Contour).

The strange part is that when I go to the output location of the tool the shapefile is there, and I can open it in ArcMap without an issue.

When I use Python to run the tool, I receive the same error message, and I can't figure out why. This is the loop I have that is meant to convert a list of DEM files into contour shapefiles:

    for dem_file in dem_files:
        file_split = dem_file.split("_")
        file_name = job_folder + "\\" + file_split[0] + "_contour.shp"
        arcpy.sa.Contour(dem_file, file_name, contour_interval)

When I run the script, I can go to the output location and bring the shapefile into ArcMap, even though there was an error. So I don't think this is an issue with my code because it also happens when I run the tool manually. Does anyone know how I can work around this error?

  • Where are you saving the output? (ie job_folder) – user681 Jul 17 '14 at 20:49
  • 1
    Try putting the output shapefile in a different folder - such as C:\temp\test_083c15_contour.shp. I think you might be having problems because 1 of your folders is named with a leading number or your output shapefile is named with a leading number. – dklassen Jul 17 '14 at 22:56
  • @dklassen I moved my job folder to the desktop, and changed the name of my output file to contour_083c15.shp and now it is working. Thanks a lot for you help! – David Jul 18 '14 at 16:16
1

Try putting the output shapefile in a different folder - such as C:\temp\test_083c15_contour.shp. I think you might be having problems because 1 of your folders is named with a leading number or your output shapefile is named with a leading number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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