I tried to iterate over the rows from a Shapefile with the search cursor. Every row is a polygon and I want to make a raster out of this polygon so I tried this with arcpy.PolygonToRaster_conversion. But it is not working. What did I wrong? This is what I have so far:
import os import arcpy arcpy.env.workspace = r"C:\Jul\birds_bear\BOTW.gdb" #path to workspace arcpy.env.overwriteOutput= True inputshp = r"C:\Jul\birds_bear\BOTW.gdb\kleiner100" outraster= r"C:\Jul\birds_bear\BOTW.gdb" rows = arcpy.SearchCursor(inputshp) count= 0 for row in rows: print row valField = "VALUE" outraster = os.path.join(outraster, "outRaster" + str(count)) arcpy.PolygonToRaster_conversion(row, valField, outraster,"","","0,0833333") count = count + 1
The shapefile has 16.400 rows. At the end I have to sum the overlapping raster with, I hope it will work for 16400 rasters, see my original question here . I can work with 10.0 and 10.2.