I have 1000 of raster file for which I am trying to extract multi values to point in a loop so that I have a series of values for each coordinate.
Here I have one raster for each week, and I want to name the field accordingly in the point shapefile's attribute table while extracting the values.
How to supply the variable name in the command line shown below
Above code line works fine when "raster_2012_1.tif" is open in window and "a specific name "2012_1" is to be assigned. However, in case of varying raster files in loop and varying field name variables are required to be assigned.
I tried to assign variables as follows,
arcpy.gp.ExtractMultiValuesToPoints_sa(path/to/pointshapefile, path/to/raster.tif field_name,"NONE")
Here I am updating field name in each loop, but it shows following error
Parsing error SyntaxError: invalid syntax (line 5)
where (line 5) is the shown code line.
I guess this problem must be occurring because of the number of arguments in the command. How to overcome this problem?
Edit: Sample code
import arcpy shapefile = 'C:\Users\Administrator\Desktop\DSBShape\Point.shp' tif = 'Raster.tif' header = 'Header' arcpy.gp.ExtractMultiValuesToPoints_sa(shapefile, tif header, "NONE")