Extract raster values at points

This tool can be used to extract the values from one or more raster images at a set of points specified by a shapefile of POINT ShapeType. The user must input the names of one or more raster images and the name of the vector points file. The attribute table of the input shapefile will be updated with fields named VALUE1, VALUE2, VALUE3... cooresponding to the input raster stack. The order of the fields will match that of the input rasters.

This tool is very similar in function to the Image stack profile tool except that it outputs values to a vector file's attribute table rather than a graphical output (line graph).


See Also:

Scripting:

The following is an example of a Python script using this tool:

wd = pluginHost.getWorkingDirectory()
# The names of the multiple input files must
# be separated by semicolons in the string.
inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
pointsFile = wd + "points.shp"
args = [inputFiles, pointsFile]
pluginHost.runPlugin("ExtractRasterValuesAtPoints", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
// The names of the multiple input files must
// be separated by semicolons in the string.
def inputFiles = wd + "input1.dep" + ";" + wd + "input2.dep" + ";" + wd + "input3.dep"
def pointsFile = wd + "points.shp"
String[] args = [inputFiles, pointsFile]
pluginHost.runPlugin("ExtractRasterValuesAtPoints", args, false)


Credits: