Hello,
I'm a student trying to process some shapefiles into raster Grid data using the polygon to raster conversion.
My goal is to batch process multiple shapefiles and save the last 12 input numbers from the shapefile name into the outputname.
I ran into a problem on python.
I get this error= ERROR 000725: Output Raster Dataset: Dataset F:\Project Folder\NCDC Toolkit Radar imagae\processed data\2006\01\01\Result\Raster_out\ already exists. Failed to execute (PolygonToRaster)
Here is the script:
# Import arcpy module
import arcpy
# Local variables:
project_input = "F:\\Project Folder\\NCDC Toolkit Radar imagae\\processed data\\2006\\01\\01\\Result\\Reproject_out\\"
raster_output = "F:\\Project Folder\\NCDC Toolkit Radar imagae\\processed data\\2006\\01\\01\\Result\\Raster_out\\"
# List features
arcpy.env.workspace = project_input
fcList = arcpy.ListFeatureClasses()
# Loop
for featureClass in fcList:
# Output
raster_outputpath = raster_output + featureClass[:-12]
# Process: Polygon to Raster
arcpy.PolygonToRaster_conversion(featureClass, "Value", raster_output, "CELL_CENTER", "NONE", "100")
print "finished polygon to raster"