I am trying to extract points from multiple raster files into a points shapefile. I have about 320,000 unique XY coordinates which need to extracted values from 37 raster files. I tried running the following code and it has been three days since it has started.
import arcpy
import os
from arcpy.sa import *
if arcpy.CheckExtension("spatial") == "Unavailable":
sys.exit("No ArcGIS Spatial Analyst licence available - exiting")
else:
arcpy.CheckOutExtension("spatial")
# arcpy.CheckInExtension("spatial")
arcpy.env.workspace = r"H:\GIS Project\in_rasters"
arcpy.env.overwriteOutput = True
arcpy.env.parallelProcessingFactor = "50"
point_feature_class = r"H:\GIS Project\XY_Points.shp"
rasters = arcpy.ListRasters("*","TIF")
for raster in rasters:
ExtractMultiValuesToPoints(point_feature_class, raster, 'NONE')
My computer has enough ram (16 gigs) and I am running it in parallel. I would think this function would take a couple of hours maximum based off this post Getting raster values for large number of point features?. Albeit, this post is not exactly the same, it still shows some anecdotal evidence for processing time with large data.
My raster files are all projected the same (WGS 84) however they do not have the same resolution.
Is it normal for this function to take a long time to finish?
Best Answer
According to the help on this tool the environment parallel processing factor isn't considered.. not many tools do parallel process.
You might get a performance increase by running all rasters at the same time but on a smaller chunk of points:
Each chunk of chunksize (default 1000) is copied into the in_memory workspace which should speed things up if you're accessing the features from a slow workspace (either a slow drive or network storage) though it will not help if your rasters are on a slow drive or network storage.
A few things to check first: