Show Navigation | Hide Navigation

Extract Values to Points

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback


Related Topics

Extracts the cell values of a raster based on a set of points.


Usage tips

Command line syntax
An overview of the Command Line window
ExtractValuesToPoints_sa <in_point_features> <in_raster> <out_point_features> {NONE | INTERPOLATE} {VALUE_ONLY | ALL}

Parameter Explanation Data Type
<in_point_features>

The name of a point shapefile to which you want to add raster values.

Composite Geodataset
<in_raster>

The name of a raster dataset to whose values you want to add a point dataset.

Composite Geodataset
<out_point_features>

The output point feature dataset recording the sample raster values.

Feature Class
{NONE | INTERPOLATE}

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
{VALUE_ONLY | ALL}

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
Data types for geoprocessing tool parameters


Command line example

ExtractValuesToPoints_sa C:/data/points1.shp C:/data/raster1 C:/data/out_points.shp NONE VALUE_ONLY

Scripting syntax
About getting started with writing geoprocessing scripts
ExtractValuesToPoints_sa (in_point_features, in_raster, out_point_features, interpolate_values, add_attributes)

Parameter Explanation Data Type
in_point_features (Required)

The name of a point shapefile to which you want to add raster values.

Composite Geodataset
in_raster (Required)

The name of a raster dataset to whose values you want to add a point dataset.

Composite Geodataset
out_point_features (Required)

The output point feature dataset recording the sample 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

Data types for geoprocessing tool parameters


Script example

# ExtractValuesToPoints_sample.py
# Description: 
#   Extracts the cells of a raster based on a set of points.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables 
    InPointsFC = "C:/data/points1.shp"
    InRaster = "C:/data/raster1"
    OutPointsFC = "C:/data/out_points.shp"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: ExtractValuesToPoints
    gp.ExtractValuesToPoints_sa(InPointsFC, InRaster, OutPointsFC, "NONE", "VALUE_ONLY")

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax
ExtractValuesToPoints (<point_vector>, <value_grid>, {NONE | INTERPOLATE}, {VALUE_ONLY | ALL} )

Parameter Explanation
<point_vector> The name of a point shapefile to which you want to add raster values.
<value_grid> The name of a raster dataset whose values you want to add to a point dataset.
{NONE | INTERPOLATE} Determines how the value of the cell is obtained.
  • NONE  — The value of the cell center will be used. This is the default.
  • 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.
{VALUE_ONLY | ALL} Determines if 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.

Map Algebra example

ExtractValuesToPoints (points1.shp, surface1)	
ExtractValuesToPoints (capitals.shp, elev2, INTERPOLATE, ALL)

ArcObjects syntax
IExtractionOp::ExtractValuesToPoints (pointDataset As IGeoDataset, valueRaster As IGeoDataset, [interpolateValues As Boolean], [allAttributes As Boolean]) As IGeoDataset

Parameter Explanation
pointDataset A feature class descriptor defining the input point feature dataset to which you want to add raster values.
valueRaster An input raster dataset whose values you want to add to a point dataset.
interpolateValues A Boolean value that determines how the value of the cell is obtained.
  • False  — The value of the cell center will be used. This is the default.
  • True  — 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.
allAttributes A Boolean value that determines if raster attributes are written to the output point feature dataset.
  • False  — Only the value of the input raster is added to the point attributes. This is the default.
  • True  — All the fields from the input raster (except Count) will be added to the point attributes.

ArcObjects example


' Function ExtractValuesToPoints(pointDataset As IGeoDataset, valueRaster As IGeoDataset, 
'   [interpolateValues 'As Boolean = False], [allAttributes As Boolean = False]) As IGeoDataset

Dim pExtractionOp As IExtractionOp2
Set pExtractionOp = New RasterExtractionOp

' Get raster dataset
Dim pRas01 As IRaster
Set pRas01 = readRasterFromDisk("c:\data\myRaster1")

Dim pFC01 As IFeatureClass
Set pFC01 = readPointFeatureFromDisk("c:\data\myPts.shp")

' Call extraction method
Dim pOutGeoDS As IGeoDataset
Set pOutGeoDS = pExtractionOp.ExtractValuesToPoints(pFC01, pRas01, True)

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.