arcpy.RasterToPolygon works, but tool errors...

1950
2
02-07-2014 04:53 AM
MatthewBarlow
New Contributor
I am having problems with:

arcpy.RasterToPolygon_conversion(inRaster, outPolygons, "NO_SIMPLIFY")

It returns the following error message even though it is successfully creating the polygon dataset:

ExecuteError: ERROR 010157: Unable to open feature class

I can view the polygon output and it is exactly as expected. However, the code fails at this point and returns the error. Any thoughts?
Tags (2)
0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Matt,

Not sure what is causing the error (may need to contact Tech Support), but you can continue to execute the rest of your script using a try/except.  Ex:

try:
    arcpy.RasterToPolygon_conversion(inRaster, outPolygons, "NO_SIMPLIFY")
except ExecuteError:
    pass
0 Kudos
MatthewBarlow
New Contributor
Hi Matt,

Not sure what is causing the error (may need to contact Tech Support), but you can continue to execute the rest of your script using a try/except.  Ex:

try:
    arcpy.RasterToPolygon_conversion(inRaster, outPolygons, "NO_SIMPLIFY")
except ExecuteError:
    pass



Hi Jake,

I was thinking I may need to do this exactly... contact Tech Support & pass the error. I will implement your suggestion and raise a support call.

Many thanks,
Matt
0 Kudos