Extract Values to Points (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

Extracts the cell values of a raster based on a set of point features and records the values in the attribute table of an output feature class.

Usage

Syntax

ExtractValuesToPoints (in_point_features, in_raster, out_point_features, {interpolate_values}, {add_attributes})
ParameterExplanationData Type
in_point_features

The input point features defining the locations from which you want to extract the raster cell values.

Feature Layer
in_raster

The raster dataset whose values will be extracted.

It can be an integer or floating-point type raster.

Raster Layer
out_point_features

The output point feature dataset containing the extracted raster values.

Feature Class
interpolate_values
(Optional)

Specifies whether or not interpolation will be used.

  • NONE No interpolation will be applied; the value of the cell center will be used.
  • INTERPOLATE The value of the cell will be calculated from the adjacent cells with valid values using bilinear interpolation. NoData values will be ignored in the interpolation unless all adjacent cells are NoData.
Boolean
add_attributes
(Optional)

Determines if the raster attributes are written to the output point feature dataset.

  • VALUE_ONLY Only the value of the input raster is added to the point attributes. This is the default.
  • ALL All the fields from the input raster (except Count) will be added to the point attributes.
Boolean

Code Sample

ExtractValuesToPoints example 1 (Python window)

This example extracts the cell values from a raster based on locations defined by a point shapefile, and creates an output point feature class of those values.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
ExtractValuesToPoints("rec_sites.shp", "elevation",
                      "C:/sapyexamples/output/outValPnts","INTERPOLATE",
                      "VALUE_ONLY")
ExtractValuesToPoints example 2 (stand-alone script)

This example extracts the cell values from a raster based on locations defined by a point shapefile, and creates an output point shapefile of those values.

# Name: ExtractValuesToPoints_Ex_02.py
# Description: Extracts the cells of a raster based on a set of points.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inPointFeatures = "rec_sites.shp"
inRaster = "elevation"
outPointFeatures = "C:/sapyexamples/output/extractvaluespts.shp"

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute ExtractValuesToPoints
ExtractValuesToPoints(inPointFeatures, inRaster, outPointFeatures,
                      "INTERPOLATE", "VALUE_ONLY")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Spatial Analyst
ArcGIS for Desktop Standard: Requires Spatial Analyst
ArcGIS for Desktop Advanced: Requires Spatial Analyst
11/8/2012