I have written the following code to convert my point files of daily max temps to rasters:
# Set local variables for Point to Raster Conversion inFeatures = Day12015Max valField = "Max_2015" outRaster = ("Rstr12015Max") assignmentType = "MOST_FREQUENT" priorityField = "" cellSize = 0.05 # Point to Raster conversion for Max values arcpy.PointToRaster_conversion(inFeatures, valField, outRaster, assignmentType, priorityField, cellSize)
I have years worth of data so this will be 365x files to process. If all my point files are in a folder, how can I write a script that will go into the folder and go down the list and convert everything and output to a new folder?
I am working with Python 2.7 and ArcGIS 10.3
I have tried the following method:
env.workspace = "C:\Users\uma.bhandaram\Desktop\DailyMax2015\Shapefiles" #folder to list shpFileList = arcpy.ListFiles("*.shp") for shpFile in shpFileList: # geoprocessing steps shpFileName = os.path.splitext (shpFile) rastFile = shpFileName + "Rast.tif" arcpy.PointToRaster_conversion(shpFile, "Max_2015", rastFile, "MOST_FREQUENT", "", 0.05)
But, this only processes one file and does not seem to loop through.