I 'm trying to automate the conversion of raster to polygon and the rasters files are in "TIF" format which is a "unsigned integer". I have the code below. However, I 'm getting an error while executing it. Could you have some suggestion please?
import arcpy, os from arcpy import env from arcpy.sa import * #To overwrite output arcpy.env.overwriteOutput = True #Set environment settings env.workspace = "C:/Subhasis/Test/Neshanic_Python/extract" outws="C:/Subhasis/Test/Neshanic_Python/extract/clip/" #checkout ArcGIS spatial analyst extension license arcpy.CheckOutExtension("Spatial") inraster = arcpy.ListRasters("*", "TIF") for i in inraster: filename=os.path.splitext(i) outPolygons= outws + str(filename) + '.shape' field = "VALUE" arcpy.RasterToPolygon_conversion(inraster, outPolygons, "NO_SIMPLIFY", field)
Error: Traceback (most recent call last): File "C:\Subhasis\Test\Neshanic_Python\extract\Clip.py", line 23, in arcpy.RasterToPolygon_conversion(inraster, outPolygons, "NO_SIMPLIFY", field) File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py", line 241, in RasterToPolygon raise e