ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Extract by Points

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Extracts the cells of a raster based on a set of coordinate points.

Usage

  • Cell locations that are not selected are assigned a value of NoData.

  • When a multiband raster is specified as input, a new multiband raster will be created as output. Each individual band in the input multiband raster will be analyzed accordingly.

    The default output format is a geodatabase raster. If an Esri Grid stack is specified as the output format, note that the name cannot start with a number, use spaces, or be more than nine characters in length.

  • If the input is a layer created from a multiband raster with more than three bands, the extraction operation will only consider the bands that were loaded (symbolized) by the layer. As a result, the output multiband raster can only have three bands, corresponding to those used in the display of the input layer.

  • If the input raster is integer, the output raster will be integer. If the input is floating point, the output will be floating point.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

ExtractByPoints (in_raster, points, {extraction_area})
ParameterExplanationData Type
in_raster

The input raster from which cells will be extracted.

Raster Layer
points
[point,...]

A Python list of Point class objects denote the locations where values will be extracted from the raster.

The point objects are specified in a list of x,y coordinate pairs in the same map units as the input raster.

The form of the object is:

  • [point(x1,y1), point(x2,y2),...]
Point
extraction_area
(Optional)

Identifies whether to extract cells based on the specified point locations (inside) or outside the point locations (outside) .

  • INSIDE — A keyword specifying that the cell in which the selected point falls will be written to the output raster. All cells outside the box will receive NoData on the output raster.
  • OUTSIDE — A keyword specifying that the cells outside the input points should be selected and written to the output raster.
String

Return Value

NameExplanationData Type
out_raster

The output raster containing the cell values extracted from the input raster.

Raster

Code Sample

ExtractByPoints example 1 (Python window)

This example extracts cells from a raster based on the specified point coordinates.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
pointList = [arcpy.Point(743050, 4321275), arcpy.Point(743100, 4321200),
             arcpy.Point(734500,4322000)]
outPointExtract = ExtractByPoints("soil", pointList,"INSIDE")
outPointExtract.save("c:/sapyexamples/output/pntextract")
ExtractByPoints example 2 (stand-alone script)

This example extracts cells from a raster based on the specified point coordinates.

# Name: ExtractByPoints_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
inRaster = "soil"
pointList = [arcpy.Point(743050, 4321275), 
             arcpy.Point(743100, 4321200), 
             arcpy.Point(743500, 4322000),
             arcpy.Point(742900, 4321800)]

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

# Execute ExtractByPoints
outPointExtract = ExtractByPoints("soil", pointList,"INSIDE")

# Save the output 
outPointExtract.save("c:/sapyexamples/output/pntext")

Environments

  • Auto Commit
  • Cell Size
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Extraction tools
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal