Does anyone know a good way to extract NetCDF raster values to each data point from a time enabled shapefile at the correct time?
I have tried using a python script tool and a loop that steps through time but it seems that the loop only works for the shapefile and not for the NetCDF raster - all shapefile values (from all time step intervals) end up getting assigned raster layer values just from the first time step interval. Both the raster and the shapefile are time enabled with the same time step interval and I have checked with Time Slider that the values of both change through time correctly.
Here is what I have tried:
mxd = arcpy.mapping.MapDocument('SST.mxd') df = arcpy.mapping.ListDataFrames(mxd) rasterLayerName = "SST" rasterLayer = arcpy.mapping.ListLayers(mxd, rasterLayerName, df) plasticLayerName = "Plastic" plasticLayer = arcpy.mapping.ListLayers(mxd, plasticLayerName, df) df.time.currentTime = df.time.startTime while df.time.currentTime <= df.time.endTime: uniqueName = "Plastic_" + df.time.currentTime.strftime("%Y_%m") outPointFeatures = "U:/gis/" + uniqueName arcpy.sa.ExtractValuesToPoints(plasticLayer, rasterLayer, outPointFeatures, "NONE", "VALUE_ONLY") df.time.currentTime += df.time.timeStepInterval