While trying to run the ArcGIS provided python script to interpolate a bunch of rasters on a time-enabled point feature class file I get the following error:
import arcpy, datetime # Check out the ArcGIS Spatial Analyst extension for using the IDW interpolation tool arcpy.CheckOutExtension("spatial") arcpy.env.workspace = "C:\Users\Chris\Desktop\interpolation\Interpolation.gdb" # Get the layer time properties lyr = arcpy.mapping.Layer(r"C:\Users\Chris\Desktop\interpolation\points.lyr") lyrTime = lyr.time # Calculate the number of iterations based on the time extent and timestep interval startTime = lyrTime.startTime endTime = lyrTime.endTime timeExtent = endTime - startTime timeStepInterval = lyrTime.timeStepInterval iterations = timeExtent.days / timeStepInterval.interval # Get the time field containing the time values associated # with the data in the time-enabled layer startTimeField = str(lyrTime.startTimeField) # Specify the output mosaic dataset to which the interpolated rasters will be added outputMosaicDataset = r"C:\Users\Chris\Desktop\interpolation\Interpolation.gdb\rasta" i = 0 while i
Runtime error Traceback (most recent call last): File "", line 34, in File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 6043, in MakeFeatureLayer raise e ExecuteError: ERROR 000840: The value is not a Feature Layer.
My code is this (line 34 is talking about making a feature class, and I cannot for the life of me figure out what it's referring to):
import arcpy, datetime # Check out the ArcGIS Spatial Analyst extension for using the IDW interpolation tool arcpy.CheckOutExtension("spatial") arcpy.env.workspace = "C:\Users\Chris\Desktop\interpolation\Interpolation.gdb" # Get the layer time properties lyr = arcpy.mapping.Layer(r"C:\Users\Chris\Desktop\interpolation\points.lyr") lyrTime = lyr.time # Calculate the number of iterations based on the time extent and timestep interval startTime = lyrTime.startTime endTime = lyrTime.endTime timeExtent = endTime - startTime timeStepInterval = lyrTime.timeStepInterval iterations = timeExtent.days / timeStepInterval.interval # Get the time field containing the time values associated # with the data in the time-enabled layer startTimeField = str(lyrTime.startTimeField) # Specify the output mosaic dataset to which the interpolated rasters will be added outputMosaicDataset = r"C:\Users\Chris\Desktop\interpolation\Interpolation.gdb\rasta" i = 0 while i