hurricaneLayerName = "Hurricanes" #replace with name of hurricane layer hurricaneLayer = arcpy.mapping.ListLayers(mxd, hurricaneLayerName, df)[0]
hurricaneLayer = arcpy.mapping.ListLayers(mxd, "hurr_data", df)[0]
#Get a reference to the map document and first data frame mxd = arcpy.mapping.MapDocument('Current') #If code is run in the app with the MXD open, otherwise pass the path to the MXD df = arcpy.mapping.ListDataFrames(mxd)[0] #Assuming here there is only one data frame in the MXD rasterLayerName = "SST" #replace with name of netCDF raster layer rasterLayer = arcpy.mapping.ListLayers(mxd, rasterLayerName, df)[0] hurricaneLayer = "Hurricanes" #replace with name of hurricane layer hurricaneLayer = arcpy.mapping.ListLayers(mxd, hurricaneLayerName, df)[0] #Loop through each time step within the full time extent df.time.currentTime = df.time.startTime while df.time.currentTime <= df.time.endTime: #Add your logic here, I assume you are using extract values to point #So we don't overwrite the output each time, we need a unique name, this will append the Year and Month value currently being processed. uniqueName = "Hurricanes_" + dt.time.currentTime.strftime("%Y_%m") outPointFeatures = r"C:\OutputDate\" + uniqueName ExtractValuesToPoints(hurricaneLayer, rasterLayer, outPointFeatures, "NONE", "VALUE_ONLY") #Set the current time of the data frame to the next time step df.time.currentTime += df.time.timeStepInterval
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.