Extract Values to Points |
|
|
Release 9.2
Last modified January 3, 2008 |
|
Extracts the cell values of a raster based on a set of points.
Usage tips
Command line and Scripting
The interpolation option determines how the values will be obtained from the raster. The default option is to use the value at the center of the cell being sampled. The interpolation option will use bilinear interpolation to interpolate a value for the cell center.
When Extract Values to Point is used on a multiband raster, it will only operate on the first band.
The Extract Values to Points tool can be used with a floating-point input raster. In this case, the resulting output point dataset will only contain attributes from the input feature data and the value of the cell, as determined by the interpolation option.
The output shapefile will have at least the RASTERVALU field added. All other items will be appended after the RASTERVALU field.
If the output point feature dataset is a shapefile, there can be no fields in the input raster with a name more than 10 characters in length. If there are, these fields must be renamed before using the Extract Values to Points tool.
For the RASTERVALU field of the attribute table, NoData cells in the value raster will be given a value of -9999.
The following environment settings affect this tool:
Map Algebra
ExtractValuesToPoints is only available from the Raster Calculator. It has not been implemented for Workstation GRID.
Only point shapefiles are supported as the <points> dataset.
The interpolation option determines how the values will be obtained from the raster. The default option is to use the value at the center of the sample cell. The interpolation option will use bilinear interpolation to interpolate a value for the cell center.
ExtractValuesToPoints can be used with a floating-point input raster. In this case, the resulting output point dataset will only contain attributes from the input point shapefile and the value of the cell, as determined by the interpolation option.
The output shapefile will have at least the RASTERVALU field added. All other items will be appended after the RASTERVALU field.
For the RASTERVALU field of the attribute table, NoData cells in the value raster will be given a value of -9999.
There can be no fields in the value raster with a name more than 10 characters in length. If there are, these fields must be renamed before using ExtractValuesToPoints.
Learn more about how to specify the input raster dataset in the Map Algebra expression of Raster Calculator.
ArcObjects
The interpolation option determines how the values will be obtained from the raster. The default option is to use the value at the center of the sample cell. The interpolation option will use bilinear interpolation to interpolate a value for the cell center.
When Extract Values to Point is used on a multiband raster layer, it will only operate on the first band.
ExtractValuesToPoints can be used with a floating-point input raster. In this case, the resulting output point dataset will only contain attributes from the input feature data and the value of the cell, as determined by the interpolation option.
The output shapefile will have at least the RASTERVALU field added. All other items will be appended after the RASTERVALU field.
There can be no fields in valueRaster with a name more than 10 characters in length. If there are, these fields must be renamed before using ExtractValuesToPoints.
For the RASTERVALU field of the attribute table, NoData cells in the value raster will be given a value of -9999.
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.
|
Boolean |
| {VALUE_ONLY | ALL} |
Determines if the raster attributes are written to the output point feature dataset.
|
Boolean |
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.
|
Boolean |
| add_attributes (Optional) |
Determines if the raster attributes are written to the output point feature dataset.
|
Boolean |
# 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.
|
| {VALUE_ONLY | ALL} | Determines if raster attributes are written to the output point feature dataset.
|
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.
|
| allAttributes | A Boolean value that determines if raster attributes are written to the output point feature dataset.
|
' 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)