Introduction to Geographic
Information Science
University of Washington Bothell
September 14, 2005
Exercise 2: Vector
Analysis
Basic Vector Analysis
Advanced Vector Analysis
Basic Vector Analysis
- Open a map document
- Create an event layer from polygon centroids
- Selecting points near a line
- Selecting adjacent polygons
- Line-on-polygon selection
- Polygon-on-line selection
- Point-in-polygon selection
- Polygon-on-point selection
- Polygon-on-polygon selection
- Spatial join: containment (inside)
- Spatial join: proximity (nearest
Open a map document
- Create a directory in your personal directory called v_an_1.
- Open ArcMap and set the working directory to the new directory (Tools >
Options > Geoprocessing > Environments).
Note: where you see M:\ in these images, use your personal directory.

- Download the map document v_an_1.mxd, and
save it in this directory.
- When the map document opens, it will appear with a data frame displaying
Pack Forest.
Create an event layer from polygon centroids
We are interested in which continuous forest inventory (CFI) plot centers are
close to streams, and what that distance is. There may be a relationship between
amount of timber, species composition, etc. and distance to streams
However, for this exercise we only have a CFI polygon layer. Because we have
the plots stored as polygons, we need to convert to points. This process will
allow us to create a point dataset from the polygons.
- Export the CFI layer to v_an_1\cfi.shp. Note that you will
now have 2 CFI polygon layers in the map, one stored on the CD and the other
on your USB drive. Make sure you can identify which is which.
- Open the attribute table for the new cfi shapefile.
- Add a field called x_coord to the table (Options > Add Field),
following this format:

This specifies the field will contain 8 integer places and 2 decimal places.
- Add a field called y_coord to the table (Options > Add Field),
following this format:

- Right-click the x_coord field and select Calculate.

You will get a warning.

Click Yes. Because we are editing a newly created field, there is no
need to worry about undoing the edit.
- Check the advanced box and enter the following text in the upper
text-entry control (copy-and-paste to avoid errors):
Dim dblX As Double
Dim pArea As IArea
Set pArea = [Shape]
dblX = pArea.Centroid.X
In the lower text entry control, enter
dblX

This process extracts the X coordinate of the polygon centroid from each polygon
and places the value on the x_coord field.
- If you get the following error message, proceed with this fix, otherwise
skip to adding Y-coordinate values.

- Uncheck the Advanced box and delete all text from the calculation
expression control:

- Check the Advanced box and re-enter
dblX

- Do the same for the y_coord field:
Dim dblY As Double
Dim pArea As IArea
Set pArea = [Shape]
dblY = pArea.Centroid.Y
dblY

- Now you should see the X and Y coordinates of the centroid on each record:

- Export the table to v_an_1\cfi_centroid_table.dbf (Options >
Export):


Now the exported table is added to the map (see the Source tab).

- Close the table.
- Right-click on the the new table in the Table of Contents and select Display
XY Data.

The dialog will automatically show the default X and Y fields.
- Click the Edit button for changing the coordinate system of the new
points.

- Click Import (we will be importing coordinate system properties from
the original CFI data set).

- Double-click cfi.shp to import its coordinate system properties.

- Now you will see the imported properties. Click OK.

Click OK to add the points to the map

- Now you will see the points display as "Events".

- Right-click the new layer and Export to v_an_1\cfi_centroid_points.shp.


- You can now delete the exported CFI polygon layer and the exported table
from the map, but keep the new CFI centroid points layer. We will use these
points in the next section.
Selecting points near a line (2 methods)
Method 1 (simple)
- From the Selection menu, choose Select By Location.

- Select features from cfi_centroid_points
that are within a distance of features in Streams with a selection
buffer distance of 50 feet, as shown:

- Click Apply and then Close. The selected points are within
50 feet of a stream.

While this method allows you to easily select features that are within a specified
distance of features in another layer, it does not tell you exactly how far
each feature is from the source.
Method 2 (more complicated, but more powerful)
- Right-click the cfi_centroid_points layer and select Joins and
Relates > Join.
- In the first dropdown, select Join data from another layer based
on spatial location.
- Click the radio button for Each point will be given all the attributes
of the line that is closest to it, and a distance field showing how close
that line is.
- Specify the output as v_an_1\cfi_spatial_join_streams.
- Click OK.

- Open the newly joined table. You will see all the attributes of the CFI
points, along with the fields from the streams layer, and a new field called
Distance. The values from the streams layer are those from the stream
that was closest to each point. The Distance field, which is created
automatically, contains the distance from each point to that closest stream
line.

- Open the properties for the cfi_spatial_join_streams layer and change
the symbology to graduated color using the brown monochromatic color ramp
based on the Distance field.

- Turn off the stands layer for a better view.

The darker plot centers are far from streams, and the lighter plot centers
are closer to streams. Do you think the proximity to streams may affect the
species composition of these plots? How would you
find out?
- Make a selection based on the Distance field:

- Open the attribute table, show only Selected records, and then sort
ascending based on Distance.

While the selection of features is identical in the two methods, by using
the joined distance field, not only do you get to select features that are
within a specified distance, it is also possible to understand the distribution
of the distances.
- Richt-click the Distance field and select Statistics. The
mean distance of plots from streams for those plots within 50 ft of a stream
is 22.8 ft.

You have just performed several actions. First, you converted a polygon layer
to a point layer by using the X,Y coordinates of the polygon centroids. This
can be useful when you want to represent or analyze polygon data as a series
of points rather than as polygons. Second, you joined a point attribute table
and a line attribute table, creating a new point layer. This is a special type
of join that always joins attributes of pairs of the closest features, and also
automatically calculates the distance between each pair of features. A point-to-line
spatial join takes advantage of the spatial relationship of proximity between
features of separate layers.
Selecting adjacent polygons
This process will select only stands that are adjacent to 70-80 year old stands
(not including the 70-80 year old stands).
- Open the Stands attribute table. Right-click the AGE_CLASS_2003
field and select Summarize.
- The only summary statistic is AREA > Sum. Place the summary table
in v_an_1\stands_age_class.dbf.


This creates a table with a unique value for each 10-year age class, containing
an additional attribute for the total area within each age class.

- Perform a Relate (right-click, Joins and Relates > Relate)
between this table and the original Stands attribute table, as shown
below:

- Select the record in age_cl.dbf for 71-80 year old stands. To select
records from the Stands table and layer, click Options > Related
Tables > age_class : polygon.
Note you could have performed this selection using a query, but you should
get familiar with this alternate, and in some ways, more efficient, method
of using summary tables and links.



Now your selection includes those stands in the 71-80 year age class.
- Next, perform a spatial selection to get stands that are adjacent to the
currently selected set. From the menu, choose Selection > Select By
Location.

- You want to select features from Stands that intersect the
features in Stands, as shown below:

Apply and Close the dialog.
- Next, in order to get a selected set of stands which are adjacent to those
in the 71-80 year age class, but excluding those in the 71-80 year age class,
from the menu, choose Selection > Select By Attributes. Your selection
on Stands should Remove from current selection those stands
which are in the 71-80 year age class.

- Because the default selection symbol is a thick cyan outline, it is not
possible to discern between selected polygons and those that are surrounded
by selected polygons. We will alter the selection symbol now. Open properties
and click the Selection tab for the Stands layer.

- Double-click the selection symbol to open symbol properties. Choose a Line
Fill Symbol.

- Make sure to use the same color (any color you choose) for the Fill Color
and Outline Color.

- Now you can clearly see those polygons that are selected and those that
are not.

Your selection of stands includes those that are adjacent to the 71-80 year
age class, but not including the 71-80 year age class.
You have just performed a selection of a group of spatial features based on
their proximity to a different set of features. This can be useful when analyzing
phenomena which are affected by proximity or adjacency. For example, if a pathogen
spreads from one area to an adjacent area, you can use this to find possible
locations of pathogen spread.
Line-on-polygon selection
Which DNR Type 4 & 5 streams pass through young to middle aged stands?
- Select young to middle aged stands (age < 40 in 2004). ESTAB_YEAR
is the year of establishment for each stand. You will need to type in the
year value 1964, rather than selecting from the list of values, since
there are no stands established in 1964.

- To make a selection of streams that pass through these selected stands,
choose Selection > Select By Location. Make a selection from Streams
that intersect with the features in Stands.

Apply and Close.
- Now reduce the selection of streams to only DNR Type 4 & 5 (Selection
> Select By Attributes). Make sure to use the Select from current
selection method.

- In order to see the selected streams more clearly, change the selection
symbol to a thick blue line:

You have just selected a set of linear features that traverse a set of polygonal
features. This is useful when analyzing the relationship between linear features
and their underlying polygons. For example, is the quality of road surface dependent
on median household income per census tract? Or is the presence of salmon in
a stream reach affected by the basal area per acre within a riparian management
zone?
Polygon-on-line selection
Which stands are traversed by tertiary roads?
- Select all tertiary roads with a query on the Roads layer. Make sure
to use the Create a new selection method.


- Use Select By Location to select features from Stands that
intersect the features in Roads.

- You can now see those stands that have at least part of a tertiary road
inside the stand boundary.
This type of analysis is the reverse of the previous analysis. In this case,
we are interested in what polygons may be affected by linear features. For example,
which municipalities does a proposed regional light-rail traverse, or which
forest stands may be affected by a diesel fuel spill in a large stream?
Point-in-polygon selection
Which CFI plot centers are within soils with moderate to high windthrow potential?
- Create a new data frame called Soil Data.
- Add the L:\packgis\forest\soils as well as the v_an_1\cfi_centroid_points.shp
(created earlier) to this new data frame.
- To make the different soil types visible, make a graduated color 6-class
natural break classification on the Windthrow.cd field in the Soils
attribute table.

- Select moderate-to-high windthrow potential soil polygons (windthrow code
greater than or equal to 3).

- Select By Location to select CFI plot centers that are contained
within moderate-to-high windthrow soils polygons.

- To make the selected set of plot centers more visible, clear the selected
set of soil polygons (right-click on the Soils layer and choose Selection
> Clear Selected Features).

You have just made a selection of points that are within a given set of polygons.
This type of analysis is valuable when determining if point measurements are
affected by the polygons in which they lie. For example, is the calculated density
from a series of inventory sample points affected by the soil type from which
the measurements were taken?
Polygon-on-point selection
Which forest stands overlap with the selected set of moderate-to-high windthrow
potential CFI plot centers?
- Make sure your selected sets for cfi_centroid_points are set to features
with moderate-to-high windthrow potential from the previous section.
- Copy the Stands layer from the to the Pack Forest data frame
Soil Data data frame.
- Use Select By Location to select stands that completely contain the
selected set of plot centers.

- You can see how the overlapping stands are selected.

- Turn off display of the plot centers in order to get a better view of the
selected stands.

This is a very cursory estimation of stands that may have moderate to high
windthrow susceptibility. It is not completely reliable because a polygon
containing even a single high-windthrow plot is flagged as "moderate
to high" windthrow susceptibility. However, it could be used as a field
reconnaissance map for investigating stands after a windstorm.
You have just selected a series of polygons that overlap with another selected
set of points from another layer. This is useful in determining if there is
a relationship between a point and a polygon layers. For example, is the species
composition of forest stands in any way related to the sampled aspect class
or soil type?
Polygon-on-polygon selection
Another way to approach the previous problem is to select forest stands that
overlap with moderate to high windthrow soil types. Polygon-on-polygon selections
are done in the same manner as the other layer-on-layer selections.
Here are a series of polygon-on-polygon selections as examples. Attempt each
one of these. The layers used are Soils (with a selection of moderate-to-high
windthrow polygons) and the Stands. The type of relationship is listed
in bold.
 |
|
Stands that
intersect
selected soils polygons,
This probably overestimates the number of stands.
|
|
|
Stands that
are completely within
selected soils polygons,
This probably underestimates the number of stands.
|
 |
|
Stands that
completely contain
selected soils polygons
|
 |
|
Stands that
have their centers in
selected soils polygons
|
Which of these most closely represents "reality?" That is really
a question for the resource specialist. The GIS can provide a number of different
scenarios, but the ultimate decision must be made by a person who knows the
resource.
Spatial join: containment (inside)
The example of analyzing CFI plots based on the underlying soil type using
layer-on-layer selections works well for a single query. However, this becomes
tedious if you want to know which plots lie in several different soil types.
This type of problem is better solved with the spatial join. In this case the
spatial join will be between a point and a polygon layer, rather than a point
and line layer in one of the previous sections.
- Clear all selections (from the menu, choose Selection > Clear Selected
Features). This clears all selections from any layer in the data frame,
whereas right-clicking on a layer in the table of contents and choosing Selection
> Clear Selected Features only clears the selection for that layer.
- Right-click the cfi_centroid_points layer and select Joins and
Relates > Join. Follow the example below to create a new point layer
that will have the attributes of the soils polygon in which each point falls.

- Open the table for the new layer to verify the attributes have been joined.
Now for each point, you can get the soils attributes for the polygon in which
the inventory plot lies. Note that the fields are renamed (periods are substituted
with underscores, and the part of the field name before the first period is
deleted).
- Make sure all selections are clear from the new point layer, then right-click
the CD field (previously WINDTHROW.CD in the soils attribute
table), and create a summary table called v_an_1\windthrow_basal-area.dbf,
with the summary statistics BA1994CPA > Minimum, Maximum, Average
and BA1994HPA > Minimum, Maximum, Average. This will create a new
table with a record for each unique windthrow code value, along with a summary
value of the minimum, maximum, and average basal area (BA) per acre per tree
class (H = hardwood, C = conifer) in 1994 per windthrow code class.

Add the new table to the map document.

This table is a summary that was made from a joined field. There may be a
pattern: plots with lower windthrow potential seem to have higher basal area.
If soils have greater potential for windthrow, then more trees should get
blown over, thus the basal area will be lower.

- Perform a relate between the summary table and the points:

- Now selections on the windthrow_basal-area summary table are
displayed on the data frame. (Remember, you could perform these selections
using a query, but a relate make the selections more efficient.)
Windthrow code 0:


Windthrow code 1:


You have just used the technique of performing a spatial join of a polygon attribute
table onto a point attribute table. This adds to the point attribute table attributes
for the underlying polygons. This is used for tasks such as determining the
soil type for a series of vegetation plot samples.
Spatial join: proximity (nearest)
Do plots closer to streams have a higher hardwood volume than plots farther
from streams? Answering this may require some tricky joining.
- Add the Streams layer to the current data frame.
- Perform a spatial join of the stands on the Join the Stands layer
attribute table onto the cfi_centroid_points layer. This will append
the attributes from the Stands layer to the CFI plot centers, creating
a new point data set.

Each plot center is coded with the attributes for the underlying stand polygon.
We now know the forest type for each plot center.
- Now join Streams onto the output of the last join:
- Open the table for the output of this join and summarize the table based
on the SPECIES field, with the summary statistic DISTANCE >
Average.

- Sort the output table in ascending order by Average_Distance.

How do you interpret the species types in the CFI sample plots with the distance
of the plots to streams? Do you expect this type of species-distance relationship
given what you know about riparian vegetation? Remember that these species
values are not the actual species measurements from the plots themselves,
but rather the predominant species for the stand in which the CFI plots lie.
This technique is used to determine if spatial location (in this case, distance
to streams) seems to have any relationship to the physical properties of the
location. You could use this to help quantitatively answer the question: for
a group of marbled murrelet nests, what underlying vegetation type is closer
to streams or farthest from roads?
Return to top
Advanced Vector Analysis
- Open a project
- Set the working directory
- Open ArcToolbox
- Append
- Clip
- Identity
- Union
- Intersect
- Create a Geodatabase
- Update
- Erase
- Buffering
- Model Building
Open a project
- Make a directory in your personal directory called v_an_2 to store
today's data.
- Download the project v_an_2.mxd, and save
it in the new directory.
- Open the map document in ArcMap.

Set the working directory
- Make sure to Set Working Directory to
the v_an_2.

Because you will be creating a number of new datasets, this will save the time
of you needing to navigate through a number of directories. (Tools > Options
> Geoprocessing > Environments.)
Open ArcToolbox
- Open ArcToolbox by clicking its button
.
- If it is not docked in the GUI, do so now. You will probably also want to
resize your application window to fit everything:

ArcToolbox is the application that contains all the overlay analysis tools.
Append
Appending layers is used to join together layers that represent the same features
on the ground, but whose spatial extents are contiguous (for example, data which
are tiled by township). Merge appends all spatial features into one layer, and
creates a single attribute table.
- Download the file sections.zip to v_an_2.
This contains two shapefiles containing Public Land Survey System (PLSS) data
for the sections covering Pack Forest.
- Unzip the zipfile.
- Create a new data frame.
- Add the two layers (sections_north and sections_south) and
the Pack Forest boundary.
- Change the display color for either the north or the south sections in order
to see the difference between the data sets.

- Export the sections_north shapefile (right-click, Data > Export)
to v_an_2\sections.shp. The reason for this is we will be appending
one data set onto another. In order to perform an append, it is necessary
to start with an existing data set, and then append other layers onto it.
- Use the Data Management Tools > General > Append tool. Select
sections_south from the Input Features dropdown. [Note: there
is another Append tool (Coverage Tools > Data Management >
Aggregate > Append) for use on coverage data sets; but in this case
we are using feature classes rather than coverages.]

- Enter sections_appended in the Output Features control. Because
the working directory was set to v_an_2, this will be the directory
location for the new shapefile. Keep the default option of Test for
the Schema Type. Testing the schema type will compare the attribute
tables for the input data sets; if the attribute structures are not identical,
an error will be generated.

Click OK to start the process.
- After the process is complete, you can close the dialog.

- The newly appended data set will be added to the data frame:

- Open the attribute table and scroll about halfway down. You will see that
all records have values, so not only were the shapes appended, but the records
were appended as well.

- Close the table and collapse the New Data Frame data frame to reduce
clutter in the Table of Contents.
Summary: You have just merged together two layers that were previously
stored separately. Now all features of both original layers are present in the
new layer. You can use this technique when you have adjacent datasets that represent
the same features.
Clip
Back in Exercise 4,
we created a new layer of culvert inventory zones. When it was created, it was
made to go well outside the Pack Forest boundary.
Clip will now be used to limit the zones to the spatial extent of Pack Forest.
- If you do not have the culvert inventory zone shapefile saved, either digitize
one now (if you think you can do it quickly), or get it here (culv_inv.shp), as a self-extracting executable.
- Extract the file to v_an_2 after you download it. This will give
you a shapefile called culv_inv.
- With the <CTRL> key pressed, click the layers Culverts
and Boundary in the Topology! data frame. Right-click and select Copy.
Collapse the Topology! data frame to reduce clutter in the Table of
Contents.
- Create a new data frame and change its name to Culvert Inventory.
The new data frame will automatically be active.
- Right-click the data frame's title and select Paste Layer(s). This
copies the Culverts and Boundary layers from one data frame
to another.
- Add the culv_inv.shp layer to the data frame. Define the projection
on the culv_inv.shp shapefile to match the sections shapefile.
You now have several layers in your new data frame.
- Change the symbology of the culv_inv shapefile by opening the layer's
properties and selecting the Symbology tab.
- Click the Import button. Choose to Import symbology definition
from an ArcView 3 legend file. A legend file specifies how a layer should
be displayed, including symbols and classifications. Browse to v_an_2\
and select culv_inv.avl.


- This is a very simple legend file that will display the polygons as thick
red outlines.


- In the ArcToolbox Search tab, enter clip as the operation
to search for and click Search. A number of different tools will be
displayed. The one we will use is from theAnalysis toolbox, so double-click
it. You can search for tools in this way if you do not remember where tools
are in the ArcToolbox hierarchy.
- The Input Features (that is, the features you want to clip) is
CULV_INV.
- The Clip Features (that is, the "cookie cutter") is
the Boundary.
- Enter the name of the Output Feature Class as v_an_2\CULV_INV_Clip_boundary.shp.

- Click OK and the process will start. After a few moments the process
will complete, after which you can Close the dialog.

- The new layer will contain the same zones, but will be clipped down to the
same overall spatial extent as the entire Forest.
- Open the attribute table of the new shapefile. Note that the attributes
from the original data source are maintained in the clipped version.
Summary: You have just used a clip to limit the spatial extent
of one polygon layer based on the spatial extent of another polygon layer. Use
this technique when you need to limit one layer by the outer boundary of another.
Sometimes you need to perform mapping or analysis of a subset of your data.
Rather than using the entire larger dataset, you can limit the extent in this
way.
Identity
Use identity to both limit the spatial extent of the output by the extent of
the identity layer, but also to carry all attributes from both input datasets
onto the output data set.
You will be creating a new National Wetlands Inventory layer that is limited
to the Pack Forest boundary extent, but which is also coded for all forest stand
attributes.
- Collapse the Culvert Inventory data frame and make the Topology!
data frame active, and turn on only the Nwi and Stands layers.
- Open the attribute tables for Nwi and Stands. Note the field
names and the values present.
- To find the Identity tool, select the Index tab in ArcToolbox
and type i, which will take you to the first matching command starting
with i, which incidentally is Identity. This is another way
of finding tools if you cannot recall where the tool is located in the ArcToolbox
hierarchy. Double-click on the entry to open the tool.
- The Input Features are the Nwi polygons;
- Set the Identity Features to Stands;
- Set the Output Feature Class to v_an_2\nwi_stands_Identity.shp.
The order of Input and Identity layers matters; if you switch the layers
used for these, the output data set will have different geometry.

- Close the dialog after the process finishes.

- The new data set looks like the original NWI polygons. But zoom into a location
indicated in the image below:

- Experiment with turning layers on and off and you will see how the spatial
properties of the original NWI data set have been altered.


- Use the Identify tool and click on an NWI polygon that overlaps with
one of the stand polygons. You will see that the polygon has all of the attributes
from both parent data sets.

- Identify one of the polygons outside the stand boundary. You will see that
all values for the stand attributes are null:

Exactly what are the area measurements for these polygons? Unfortunately the
area values are not automatically updated by the Identity function. In order
to update the Area field for the shapefile table, it is necessary to
perform a field calculation.
- Open the table for the new shapefile, right click
on the Area field and select Calculate. Perform an Advanced
calculation. In the Pre-Logic VBA Script Code control, enter (you can
cut-and-paste):
Dim dblArea As Double
Dim pArea As IArea
Set pArea = [Shape]
dblArea = pArea.Area
and in the AREA = control, enter
dblArea

- If you get the following error message, proceed with this fix, otherwise
skip to adding calculating perimeter values.

-
Uncheck the Advanced box and delete all text from the calculation expression
control:

- A similar process can be used to update the Perimeter
field, with the following strings:
Dim dblPerimeter as double
Dim pCurve as ICurve
Set pCurve = [shape]
dblPerimeter = pCurve.Length
dblPerimeter

- Review the table for changes to the AREA and PERIMETER fields. Unfortunately
overlay operations on shapefiles do not recalculate geometric fields, so this
is a process that needs to occur manually.
Summary: You have just created a new layer based on the overlap of two
input layers. If any areas overlap between the two input layers, the polygons
representing those areas have attribute values from both inputs. Where there
is no overlap, only the input attribute values exist. This technique is used
to identify areas that are common between two layers, but only the coordinate
data from the input layer exist in the output, and where shapes overlap, features
are split.
Intersect
Contrast Intersect with Identity. The same layers will be used, Nwi
and Stands, but instead of an Identity, use an Intersect.
- Open Analysis Tools > Overlay > Intersect.
- Again, select NWI and Stands as the Input Features
.
- The Output Feature Class can be called anything you like, but
I suggest using v_an_2\nwi_stands_Intersect.shp.

- After you have selected both layers, click OK. In this case, the
order in which you select layers does not matter, because the output will
only contain geometry that is clipped to the common geometry of all
input data sets. Note that you can also get the intersection of more than
just two data sets.
You can see how the Identity output has the same overall geometry of the Nwi
data set, whereas the Intersect output is clipped to the common areas of both
Nwi and Stands.

- Open the attribute table for the new layer. Note that fields exist for
both input layers.

Summary: Identity and Intersect are similar in what they do, except
that the output spatial extent differs. Where there is no overlap, polygon areas
are deleted.
Create a Geodatabase
One of the several advantages to using a geodatabase is that feature geometry
fields (area, perimeter, and length) are stored as an integral part of the data
set. When updates are made to the geometry of features (reshaping, resizing,
splitting, etc.), the fields representing geometric measures are automatically
updated. In this section you will create a geodatabase that will store the output
of subsequent analyses.
- Open ArcCatalog and navigate to the v_an_2 directory.
- Select File > New > Personal Geodatabase.

- Rename the geodatabase to v_an_2.

The new personal geodatabase is stored as a single file on the OS, currently
empty, but soon to contain a number of different feature classes.
Summary: You have just created an empty geodatabase. The geodatabase
will store feature classes and tables, but a geodatabase can also store map
documents and custom toolboxes.
Union
Union the Soils polygon layer and the Stands polygon layer.
- In ArcToolbox, open the Union tool. Like Intersect, the order of
input and overlay does not matter.
- In ArcMap, use the <CTRL> key and select both the Soils
and Stands layers. Drag these into the Features control in the
Union tool.

- Rather than entering a name for the output data set, click the Browse button
and navigate inside the geodatabase. Enter the name soils_stands_union
for the output feature class.

- Click Save for the Output Feature Class and OK the tool.

- Note that the new feature class combines the geometries from both input
layers.

- Identify one of the polygons to view its attribute structure. Note
how both parent layers' attribute fields and values appear in the new layer's
table.

- Open the table for the new layer and scroll all the way to the right.

Note the fields Shape_Length and Shape_Area. These represent
perimeter and area for each polygon. These values are automatically generated
and updated. Note that the original Area and Perimeter fields
exist; because the feature geometry has been altered, these fields are no
longer valid (you can easily see this by looking at the identified feature
above: AREA = 6279539 ft^2, Shape_Area = 812053 ft^2).
Summary: Union is similar to Identity and Intersect, but all features
from all input layers are preserved in the output. Remember that in Identity,
only the geometries from the input layer are preserved; in Intersect, only common
geometries are preserved.
Identity and intersect can pair polygon layers with point or line layers as
well as with polygon layers.
Update
Use Update to replace the contents of one polygon layer with the contents
of another. Here, we will update the Soils layer with the Lakes
layer. This can be useful if you have a newer or more accurate dataset that
you would like to use to replace parts of an existing dataset.
- Add the L:\packgis\forest\lakes layer to the data frame.
- Open the Update tool from ArcToolbox.
- Drag Soils from ArcMap into the Input Features control.
- Drag lakes polygon to the Update Features control.
- Browse to the geodatabase and set the name of the new data set to soils_updated_with_lakes.

- After the process completes, zoom in to an area where lakes exist (see
image below).

- You can see the original Soils polygons show water features (if
you change the symbology to show unique values based on SOIL.NAME
this becomes apparent).

- The new data set has its geometry updated with the features from the
lakes polygon layer.

- Select one of the features. In this case, the new feature's geometry
originates from the lakes polygon layer, but the area the new polygon
occupies was originally an area of overlap between WATER and SCAMMAN
soils. What happens to the attribute structure in this case?

- Open the attribute table and show only Selected records. You
will see there are actually 2 records selected. Apparently this is because
the new geometry cannot "decide" whether it is Scamman or Water,
since the new shape overlaps with more than 1 input polygon. This could
be a big problem because we expect layers such as soils not to have overlapping
polygons! [My testing has shown that the same problem does not occur when
using ArcInfo coverage source data and the Coverage Analysis Update tool
in ArcToolbox, but to use this tool, the input coverages must have identical
attribute structures.]

Summary: You have just replaced parts of one polygon layer with polygons
from another layer.
Erase
Contrast Update with Erase. Erase removes the overlapping features
from the input layer. In this example, remove the Lakes areas completely
from the Soils layer.
- Open the Erase tool.
- The Input Features is set to Soils.
- The Erase Features ("cookie cutter") is lakes polygon.
- Place the output in the geodatabase as soils_erased_with_lakes.

- It is obvious what Erase does by viewing the new data set.

The places where lakes were have been completely deleted from the Soils
layer.
Summary: You have just deleted parts of one polygon layer using polygons
from another layer. Anywhere there was overlap, areas have been removed.
Buffering
Buffering creates a new polygon layer at either constant or variable distance
from features in an input layer. In this exercise you will create variable-width
buffers around roads based on the road type. You will associate a buffer distance
for each road segment by creating a summary table and temporarily joining the
summary table to the roads table. This is a preferred method because it does
not permanently alter the roads table; once the buffer is complete, the join
can be broken.
- Create a new data frame called Road Buffering.
- Add the Roads layer this data frame.

- Create and alter a summary table from the roads table.
- Open the attribute table for the layer.
- Perform a summary based on the USE field.
- Do not specify any summary statistics
- Specify the output table as v_an_2\roads_use_summary.

- Add the table to the map.

- Open the table.

- Add a field called buff_dist, 2 integer columns wide.

- Using the Editor toolbar (you may need to View > Toolbars
> Editor from the menu) and select Start Editing. Update
the values of the buff_dist field as shown here. These are the
buffer widths that will be applied to each road use type, for example,
HIGHWAY road features will be buffered by 30 feet.

- After your edits are complete, stop editing (and save your edits).

- Join the summary table onto the roads table using the USE field
as the joiner.

- Now you will see that the roads table has the buff_dist field.
Remember that joins are temporary, so after the buffer is complete you
can remove the join and your roads table will be unaffected.

- Open the ArcToolbox > Analysis Tools > Proximity > Buffer
tool.
- The Input Features should be set to roads arc.
- Set the Output Feature Class to roads_buffer_by_use
within the geodatabase.

- Select the Field radio button. Select the joined buff_dist
field. This instructs ArcGIS to use buffer values on a feature-by-feature
basis, controlled by the value of the buffer distance on each feature's
record.

- Scroll down and make sure to choose Dissolve to ALL
(but be aware what this does by looking at help in the dialog).

- Click OK to start the buffer process. After a few moments
the process will be complete. Zoom in to view the output. You will
see that different roads are buffered at different distances.

Summary: You have just created variable-width buffers of road features.
The buffers define an area that is a discrete distance from each buffered road
segment. Any vector feature can be buffered in this way. It is common to buffer
features in order to delineate areas of influence, or to create areas of altered
land use. For example, under current forest regulations, depending on the stream
class, different activities are permissible at different distances from the
stream channel.
Model Building
Each of the steps you have just completed were performed on a "manual"
basis. Suppose you wanted to string a series of these tasks together. Rather
than performing each task sequentially, it is possible to build a model that
will run all the processes in the order you choose. This exercise will teach
you how to make a custom toolbox, add a model to the toolbox, and run the model.
In this exercise, you will create a model that summarizes the area of different
soil names and forest age classes within a constant width road buffer.
- First, convert the soils, stands, and roads to the
geodatabase.
- Open the tool Conversion Tools > To Geodatabase > Feature Class
to Geodatabase (multiple).
- Drag each of these, one at a time, from L:\packgis\forest\ into
the dialog from ArcCatalog
- roads\arc
- soils\polygon
- stands\polygon
- Set the Output Geodatabase to the one you have been using (v_an_2\v_an_2.mdb).

- Click OK. After a few moments the process will complete.
- Right-click in ArcToolbox and select New Toolbox. Change the
new toolbox name to your name.

- Click on the new toolbox, then right-click and select New > Model.


- The new model will open.

- Using ArcCatalog, drag the 3 new feature classes into the model.


- Find and drag into the model each of the Analysis Tools Overlay
> Intersect, Overlay > Clip, and Proximity > Buffer.

- Use the Add Connections tool
to connect the stands and soils to the Intersect
tool.

- Use the Add Connections tool to connect roads to the Buffer
tool.

- Connect the output of Intersect and the output of Buffer
to the Clip tool.

- Double-click the Buffer tool to sets its parameters.
- Set the Distance to 50 Feet.
- Set the Output Feature Class to road_buffer_50_ft
in the geodatabase.

- Scroll down and set the Dissolve Type to All.

This parameterizes the buffer tool so that it will use these settings
during run time.
- Open the Clip tool to parameterize it as well.
- The Input Features is the output of the Intersection.
- The Clip Features are the road buffers.
- Set the Output Feature Class to soils_stands_clipped_by_50_ft_road_buffer.

- The Intersect tool does not need to be parameterized because
there is no order of precedence for intersection.
- Click the Auto Layout button
and the Full Extent button
to get a better view of the model.

- Right-click on the final output and select Add To Display so
that the output of the model is added to the map display.

- Now the model is ready to run. Click the Run button
.
- The progress indicator will tell you when the process is complete.

Note that after the model has run, any of the tools and output data sets
have a drop shadow.

- The new data set will be added to the data frame. If you zoom in you
will see a complex geometry (remember, this is from the combination of
stands and soils).

- Open the table for the new data set. Create two summaries, one based
on the SPECIES field with the summary statistic Shape_Area >
Sum.
Put the output table in the geodatabase (note that you can store many
things in a geodatabase, including spatial data sets, stand-alone tables,
tools, even map documents).


And add the result to the map document.

- Also summarize the soil name field:



- Open the tables that were added to the map document.
These tables give you summaries of the area within each soil type within
the buffer zone and the area within each different species type within
the buffer area.


- If you would like to attempt this with variable-width buffers, you will
need to modify the model. Here is an image of a model that joins the buffer
distance table to the roads layer. Give this a try if you want. The parts
to be careful configuring are parameterizing the Add Join tool,
parameterizing the Buffer tool to use the joined field for specifying
buffer distances, and parameterizing the Clip tool so that the
buffers clip the intersected data set.

And the output:

Summary: The model builder is a powerful and efficient tool which can
streamline workflows. One of the benefits of using the model builder is self-documentation.
The models can be saved and run again, whereas if you simply use a series of
manual operations, it may be difficult to recreate the process exactly. Models
can also be placed within geodatabases or saved as files for distribution. You
could bundle a number of data sources along with a model to allow a collaborator
to validate your methods.
Return to top
Copyright © Phil Hurvitz, 1998-2004