Você está na página 1de 36

EXTRACTION

An overview of the Extraction tools


The Extraction tools allow you to extract a subset of cells from a raster by
either the cells attributes or their spatial location. You can also obtain the
cell values for specific locations as an attribute in a point feature class or
as a table.
The tools that extract cell values based on their attribute or location to a
new raster include the following:
Extracting cells by attribute value (Extract by Attributes) is
accomplished through a
where clause. For example, your analysis may require an extraction of
cells
higher cells by the geometry of their spatial location requires that
Extracting
than 100
meters in elevation from an elevation raster.
groups
of cells
meeting a criteria of falling within or outside a specified geometric
shape
(Extract
byby specific locations requires that you identify those
Extracting
cells
Circle, Extract
locations
either by Polygon, Extract by Rectangle).
by their x,y point locations (Extract by Points) or through cells
identified using a
mask raster (Extract by Mask).

The tools that allow you to specify the locations for which to extract cell
values to an attribute table or a regular table include the following:
Cell values identified by a point feature class can be recorded as an
attribute of a new
output feature class (Extract Values to Points). This will only extract the
values from
one
Cell input
valuesraster.
identified by a point feature class can be appended to the
attribute table
of that feature class (Extract Multi Values to Points). Cell values from
multiple
The
rasters
alsofor
beidentified
identified.
cell can
values
locations (both raster and feature) can be
recorded in a
table (Sample).

The following table lists the available Extraction tools and provides a
brief description of each.
Tool

Description

Extract by
Attributes

Extracts the cells of a raster based on a logical query.

Extract by Circle

Extracts the cells of a raster based on a circle.

Extract by Mask

Extracts the cells of a raster that correspond to the areas defined by a mask.

Extract by Points

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

Extract by
Polygon

Extracts the cells of a raster based on a polygon.

Extract by
Rectangle

Extracts the cells of a raster based on a rectangle.

Extract Multi
Values to Points

Extracts cell values at locations specified in a point feature class from one or more
rasters, and records the values to the attribute table of the point feature class.

Extract Values to
Points

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.

Sample

Creates a table that shows the values of cells from a raster, or set of
rasters, for defined locations. The locations are defined by raster cells
or by a set of points.

Extracting cell values to point features


The cell values from raster data can be extracted directly to the
attributes of point feature data. This can be done in two wayseither by
creating a new feature output or by appending the values to the existing
point feature class.

Extracting cell values to a new point feature dataset

With the Extract Values to Points tool, you can use a point feature dataset
to define the
locations for which you want to extract the cell values from a single
raster. These values will be recorded to the attribute table of the feature
Appending
dataset. cell values from rasters to a existing point feature dataset
With the Extract Multi Values to Points tool, you can use a point feature
dataset to define the locations from one or many rasters you want to
extract the cell values from.

The differences between this tool and Extract Values to Points are the
following:
This tool just appends the cell values to the attribute table of the
input feature
dataset. It does not create a new feature dataset.
This tool just appends the cell values to the attribute table of the
input feature
dataset. It does not create a new feature dataset.
Supports multi-band raster dataset input.

Related Topics
An overview of the Extraction tools
Extract Multi Values to Points
Extract Values to Points

Extraction by attribute, shape, or location


A subset of cells can be extracted into a new raster in several waysby a
selecting an attribute or a defined shape or by using another raster.

Extraction by attribute
Cells that meet a specified attribute query can be extracted to a new
output raster with the Extract by Attributes tool.
Examples of applications for this tool include the extraction of all cells
that have a slope
greater than 10 percent or the extraction of all cells attributed with
zoning for commercial development. All cells that meet the query will
return, for the cell location, the original value that was queried.
The cells that meet the specified query do not have to be contiguous.

Extraction by shapes
You can extract cells based on a specified shape. You have the option to
extract only the cells that fall inside or outside the shape. You can
extract by a circle, rectangle, or polygon.

Circular area extraction


To perform a circular extraction, use the Extract by
Circle
tool. of the center of the circle and the radius must be specified.
The location
In the image below, all cells (cell centers) that fall within the circle
are extracted:

Rectangular area extraction


To perform a rectangular extraction, use the Extract by Rectangle tool.
The lower left and upper right corners of the rectangle must be identified.
In the image below, the cells inside the specified rectangular shape were
extracted.

Polygonal area extraction


To perform an extraction based on a polygonal shape, use the Extract by
Polygon tool.
The location of the vertices of the polygon must be
input.
In the image below, an extraction polygon was identified, but a
parameter was specified to extract the cells outside rather than inside
the polygon.

Extraction by location
Cells can be extracted based on their spatial location. The cells to
extract can be determined by individual point locations or from a group
of locations of any size or shape as identified by a mask.

Point location extraction


You can extract particular cells from a raster by defining a list of the
coordinate points you are interested in.
To perform an extraction based on points, use the Extract by Points tool.

The points must be identified by their x,y coordinate


locations.
Extractions with a mask
Another dataset, the mask, can be used to identify the cells that will be
extracted to a new raster. The mask can be either a raster or a feature
dataset.
To perform this type of extraction, use the Extract by
Mask
There tool.
are a number of ways to create a mask raster using various ArcGIS
Spatial Analyst tools.
In the extraction tool, as demonstrated in the image below, those
locations that are not
NoData in a mask raster will retain the value assigned to that location in
the Input raster.

A feature dataset can be used for the mask. Only cells that fall within
the specified shape of the feature data will receive the values of the
Input raster on the output raster.

GENERALIZATION

Altering the resolution of a raster


There are tools available that alter the resolution of an existing raster. If
you have one raster at a finer resolution than other rasters, you may
want to resample the finer resolution raster to the same resolution of the
coarser ones, making all the raster datasets the same resolution. This
speeds up processing and reduces data size. Unlike the Cell size setting
in the analysis environment, the resolution altering tools are applied only
to the resultant raster. The top graphic shows a raster of an area at a fine
resolution, while the graphic immediately below it shows a raster of the
same area with a coarser resolution.

Raster of an area at a fine resolution

Raster of an area at a coarse resolution

The two principal ways to determine resulting values when changing the
resolution of a raster dataset are interpolation and aggregation.

Interpolation
The interpolation method is used by the Resample tool in the Raster
toolset of the Data Management toolbox. It uses either the nearest
neighbor, bilinear, cubic interpolation, or majority resampling methods
on the values of the input raster.
Aggregation
The aggregation method uses a specified statistical aggregation method
within a
neighborhood to derive values in the output raster at the different
resolution. This method is used by the Aggregate and Block Statistics
AggregateWith this tool, Spatial Analyst aggregates a group of
Spatial Analyst tools.
cells to the same
value to produce a single, coarser resolution cell. The types of
statistics available
Block StatisticsWith this tool, Spatial Analyst calculates a specified
to aggregate the input values are Sum, Min, Max, Mean, and
statistic within
Median.
non-overlapping neighborhoods.
The main difference between them is that there is no concept of a
neighborhood in
Aggregate as there is in Block Statistics, since the would-be
neighborhood and output blocks are always square, and the size of the
would-be neighborhood is a function of the aggregation of cells that is
necessary to obtain the desired resolution.

An overview of the Generalization toolset


The generalization analysis tools are used to either clean up small
erroneous data in the raster or generalize the data to get rid of
unnecessary detail for a more general analysis.
There are several common sources for the erroneous data, such as the
following:
Classified satellite imagery may contain many small areas of
misclassified
Images thatcells.
are scanned paper maps may contain unnecessary lines
or
text.
Conversion
issues from rasters in different formats, resolutions, or
projections may
exist.
The generalization tools help you identify such areas and automate the
assignment of more reliable values to the cells that make up the areas.
The generalization tools are divided into three general categories:
Those that generalize on zones.
(Nibble, Shrink, Expand, Region Group, and Thin)
Those that smooth zone edges.
(Boundary Clean and Majority Filter)
Those that alter the resolution of the data.
(Aggregate)

The following table lists the available Generalization tools, and provides a
brief description of each.
Tool

Description

Aggregate

Generates a reduced-resolution version of a raster. Each output cell contains


the Sum, Minimum, Maximum, Mean, or Median of the input cells that are
encompassed by the extent of that cell.

Boundary
Clean

Smoothes the boundary between zones by expanding and shrinking it.

Expand

Expands specified zones of a raster by a specified number of cells.

Majority
Filter

Replaces cells in a raster based on the majority of their contiguous


neighboring cells.

Nibble

Replaces cells of a raster corresponding to a mask with the values of the


nearest neighbors.

Region
Group

For each cell in the output, the identity of the connected region to which
that cell belongs is recorded. A unique number is assigned to each region.

Shrink

Shrinks the selected zones by a specified number of cells by replacing them


with the value of the cell that is most frequent in its neighborhood.

Thin

Thins rasterized linear features by reducing the number of cells representing


the width of the features.

Creating individual zones with Region Group


A zone is composed of all cells in a raster with the same value. Regions
are a contiguous set of cells of the same zone type. Zones can consist of
several disconnected regions. When the regions need to be processed
separately, each must be identified as a separate entity. The Region
Group tool assigns a new value to each region in a raster. The values are
assigned by the scanning process, which starts in the upper-left corner of
the raster and moves left to right, top to bottom. As each new region is
encountered, a unique value is assigned to it. The process continues until
all regions have been assigned a value.

Several disconnected regions


exist within
zones before Region Group.

Each region (disconnected


zone) is
assigned a unique zone value
after
Region Group.

In the output raster's attribute table, the Value and Count items exist as
usual, but a third item, Link, is also created. The Link field stores the
original input zone values. With this connection back to the parent
values of the input, additional analysis can be completed.

Generalization of classified raster imagery


One of the most common applications of the Generalization tools is the
process of cleaning up a classified image that was derived from remotesensing software. The classification process often results in many
isolated small zones of data that are either misclassified or irrelevant to
the analysis.

Creating a generalized land-use map from a


satellite image

The following example demonstrates a typical sequence of applying the


generalization tools to produce a raster layer that is more suitable for
presentation or subsequent analysis.
Each tool can be used alone or in combination with other data cleanup
tools for various applications.

Starting with a raw satellite scene


The image below shows the raw satellite image that will be classified.
While the classification process will not be explicitly described, the
following section will detail some of the reasons that the direct result
typically needs some further processing to be generally useful.

Raw image to be generalized

Image result after classification


satellite image. The training samples are taken in different land uses
to identify water, residential, hardwoods, conifers, and so on. From
these training samples, all other cell locations in the image are
allocated to one of these known land types or uses. Sometimes landuse signatures (statistics derived from the training samples) are
similar, making it difficult to distinguish between two classes. For
example, with the existing training samples, the software may not be
able to distinguish between an alder swamp and a wetland with
hardwoods. This may be due to an inadequate number of training
samples or the fact that certain land uses were never sampled at all.
These limitations, as well as others, can lead to the misclassification
As a result, a single or a small group of cells may be misclassified as
of certain locations.
an entity different from the sea of cells surrounding it, when in
reality, the entity belongs to the group of cells that surrounds it.
Another typical area of misclassification is the boundaries between
different land uses. Often, what results is a jagged, unrealistic
representation of the boundary that can be smoothed with the
generalization tools.
Below is the classification of the satellite image. Notice there are
many small, isolated single cells or groups of cells throughout the
image.

The following sections demonstrate how the generalization tools can be


applied to produce a final classified raster.

Removing misclassified cells with Majority Filter


To remove the single, misclassified cells in the classified image, the
Majority Filter tool is applied. The results are displayed in the image
below. Notice that many of the smaller groups of cells have
disappeared.

Raster after Majority Filter applied

Smoothing zones with Boundary


Clean
To smooth the boundaries between zones, the Boundary Clean tool
can be implemented. By expanding and shrinking the boundaries, the
larger zones will invade smaller zones, as is the case in the image
below. Again, notice that even more of the smaller and thinner
groups of cells have disappeared.

Raster after Boundary Clean applied

Identifying clusters with Region


Group
The Majority Filter and Boundary Clean tools will only process out the
single or very small clusters of a few misclassified cells by assigning
them to the value that appears most frequently in the immediate
neighborhood. Suppose, however, that there is a certain size
threshold below which individual groupings of like cells are considered
too small to be meaningful in the ensuing analysis. These clusters
should instead be dissolved into the surrounding groups. For example,
any contiguous clusters of the same land-use category that are
smaller than 7,200 square meters in size are deemed not significant
to the analysis. However, these isolated regions cannot be individually
processed, since they have the same land-use value as the entire
zone.
To resolve this issue, the Region Group tool is applied. This tool will
assign a unique
identifier to each region in the input raster (the classified image). A
region is any contiguous group of cells of the same value. Consider a
single zone composed of two regions that are not connected. Region
Group will divide this zone into two new zones, each having a unique
identification (zone) value. The original zone value is maintained as a
LINK field in the output attribute table. The resulting raster is shown
below and displays the many different output zones.

Raster after Region Group applied

Remove areas smaller than threshold


Next, using a selection tool, such as the Extract by Attributes tool in
the Extraction toolbox, an output raster is created where regions
smaller than the area threshold have been removed.

Very sm all regions selected and removed to use as a


Mask

Eliminating small regions with Nibble


Using the Nibble tool on the resultant raster from the extraction tool
(identifying the regions to eliminate) and with the values from the
classified image raster, the tool visits each cell location to eliminate
and replaces it with the closest cell with a value on the classified
raster.

Small regions identified in the mask eliminated with


Nibble

Final generalized land-use map


Using the link item from the results of the Region Group tool, the
original zone values from the classified image are reassigned to the
individual regions created from the Region Group tool.

Final generalized land-use map


The result is a more generalized land-use map, which can be used in
subsequent analyses.

Generalizing zones with Nibble, Shrink, and Expand


Spatial Analyst tools that generalize zones include Nibble, Shrink,
and Expand.

Nibble

The Nibble tool allows selected areas of a raster to be assigned the


value of their nearest neighbor. This is useful for editing areas of a
raster where the data is known to be erroneous.
First, the algorithm determines all areas from the mask raster with the
value NoData. The corresponding areas on the input raster will be
nibbled. Second, an internal Euclidean allocation is performed to
allocate values to the masked cells based on Euclidean distance.
The value of the cells from the input raster that correspond to the cells
of NoData from the mask raster are nibbled and replaced by the value
of the nearest neighbor according to Euclidean distance.

In the following image, Nibble was applied to the input and mask
rasters. Nibble will only be applied to the NoData values in the mask
raster. Notice all non-NoData cells on the mask raster receive the value
from the input raster. These cell values and their locations will be used
to assign values to the NoData locations identified on the mask raster.
The NoData locations will receive the value of the cell in the input
raster that is identified as the closest non-NoData cell on the mask
raster.

OutRas = Nibble(InRas1, Mask_Ras)

Shrink
The Shrink tool shrinks specified zones by replacing them with the
value of the cell that is most frequent in its neighborhood. In Shrink,
the values of spurious cells along zonal boundaries are changed to the
value of their highest frequency neighbor. Any cells that are not
internal cells (those that cannot be viewed as a center to eight nearest
neighbors of the same value) may be replaced.

For example, a region that is 2 cells wide and 10 cells long will be
removed, since it will shrink by one cell from two different
directions. If you shrink by two cells, the smallest size region that
can be retained is a 5-by-5 block of cells.
When you shrink by more than one cell, conceptually, it is like
running the tool as many times as the number of cells to shrink with
the results of the previous run being the input to the subsequent
iteration.
For example, if you shrink by two cells, conceptually, it is like
running Shrink by one cell on the input raster and shrinking the
identified zones and using the output of the first shrink as the input
for the second shrinking.
In the image below, Shrink is applied to the input raster, so zone 5
shrinks by one cell. Zone 5 is no more than two cells wide in any
area; therefore, all cells containing 5 are replaced with the value of
highest frequency in its neighborhood. NoData invades two locations
at the bottom right, since it is the value of highest frequency to the
two locations.

OutRas = Shrink(InRas1, 1, [5])

In the image below, Shrink is applied to the input raster, so zones 4


and 6 shrink by one cell. In the upper left corner, a value 4 remains,
since it is deeper than one cell.

OutRas = Shrink(InRas1, 1, [5])

Expand
With the Expand tool, certain zones can expand into other zones.
Conceptually, selected values can be viewed as foreground zones,
while others remain background zones. The foreground zones can
expand into the background zones.
In the image below, the Expand tool is applied to the input raster
with zone 5 expanding one cell. Notice that zone 5 expanded into
the NoData values in the lower right.

OutRas = Expand(InRas1, 1, [5])

How Aggregate works


The Aggregate tool resamples an input raster to a coarser resolution
based on a specified aggregation strategy (Sum, Min, Max, Mean, or
Median).
Conceptually, the tool works as follows:
1. It multiplies the cell resolution of the input raster by the factor
specified by the cell factor parameter. The resulting value
corresponds to the cell resolution of the output raster.
2. It maps the spatial extent of the output cells onto the input
raster.

The coarser output cells mapped onto the input raster

3. It identifies the cells on which to perform the aggregation


calculations. Cell
locations from the input raster that fall within the extent of an
output cell are
4. It
calculates
thecalculations
output value
determiningthat
thecell's
sum,output
included
in the
forbydetermining
minimum, maximum,
value.
mean, or median value of the cells from the input raster that fall
within the
output cell's spatial extent.

The aggregation value is written to each cell on the


output
raster.

Depending on the value specified for the cell factor (whether the
division of the cell factor by the number of cells in a row or column
leaves a remainder), the spatial extent of the input cells will not cover
the same extent for the last cell in a row or column as the output
raster. When this occurs, the value for the last output cell can be
calculated with the available cells from the input raster that fall within
the extent (Expand extent checked), or the raster can be
truncated by removing the last cell from the output raster (Expand

The input raster

Output with the Expand option set

The coarser output cells cover a larger extent than


the input
cells.

Output with the Truncate option set

Você também pode gostar