
Introduction to
Geographic Information Systems in Forest Resources |
Exercise: Vector Analysis
I
- Open a project
- Create an event theme 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)
- Spatial merge
Open a project
Create a directory in your personal directory called vec_an_1. Download
the project v_an_1.apr, and save it in this directory.
Make sure your working directory is also set to this location. Use the Startup Project to open the project file you just downloaded.
When the project opens, it will appear with a view of Pack Forest.
Create an event theme from polygon centroids
We are interested in which CFI plot centers are close to streams, and what
that distance is.
However, we are stuck without a CFI point theme. First, create a CFI plot centers
theme. Because we have the plots stored as polygons, we need to convert to points.
Make sure to follow these steps in precise order. The order of activation of
the script and view documents is crucial.
- Make the Cfi.shp theme active.
- From the menu, select Theme > Convert to Shapefile. Save it as
cfi.shp on your Zip disk.
This is necessary because we are going to modify the shapefile, and the one
on the CD is write-protected.
- When prompted, add the shapefile to the current view.
- You will have 2 Cfi.shp themes in the view.
Delete the original Cfi.shp theme from the view. That will minimize
confusion as to which theme is which.
- In the project window, single click on the Scripts icon,
double click on the View.AddXY.ave script to open it. The script
contains commands to add X and Y coordinates for each polygon centroid to
the theme table.
- Make sure the Pack Forest view document is active, and that the active theme
is the new CFI theme.
- Make the script document active, and click the Run button
.
This will add explicit X and Y coordinates to the table for Cfi.shp.
It is important to have the script active first and then the view, so the
script knows to act on the view.
- Open the theme table for Cfi.shp. You should see new fields for X
and Y coordinates on the table.
- Make the view document active.
- From the menu, choose View > Add Event Theme, and use the table
Attributes of Cfi.shp.
This will add a new theme, called Attributes of Cfi.shp. The theme
is a point event theme where the location of the points was taken from the
original polygon centroids, but the theme's table will also contain all other
attribute values from the original polygon theme.
- Convert this new theme as a shapefile of its own, called plot_centers.shp,
and add it to the current view. The theme you are looking at is not a shapefile,
but is only the representation of a table. Converting this to a shapefile
will create a new data set that will give us more flexibility and control
over the theme.
- Now you can delete both the newer Cfi.shp theme and the Attributes
of Cfi.shp theme.
Make them both active themes and select Edit > Delete Themes from
the menu, and choose Yes to All in the Delete Themes dialog.
You have just successfully created a new point theme from an existing polygon
theme.
Note that you have just used a script to perform an action. All actions in
ArcView are controlled by scripts, which are usually associated with buttons
or menu choices. In this case, the script was run by using the script document.
To calculate X and Y coordinates, optionally, you could have made the proper
theme active and clicked the
button, which runs the same script as you ran
manually. I've had you go through running the script manually just so you
can see how scripts are run from a script document rather than from the GUI.
Selecting points near a line
- Open the theme table for Streams, and make the Shape field
active.
- Open the theme table for Plot_centers.shp, and make the Shape
field active. Make sure that the Attributes of Plot_centers.shp table
is the active document or your join may not work correctly.
- Click the Join button
. The Streams
table will disappear, but the attributes for this table will be appended to
the Attributes of Plot_centers.shp table.
- Open the newly joined table. You will see all the attributes of the CFI
points, as well as a new field called Distance, and then the fields
from the streams theme. The Distance field, which is created automatically,
contains the distance from each point to the closest stream line.
- Open the Legend Editor for the Plot_centers.shp theme, and
choose Graduated Color as the Legend Type, set Classification Field
to Distance, and select Beige to Brown as the Color Ramp.

- Turn off the Stands theme and turn on the Plot_centers.shp
theme.
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?
You have just performed several actions. First, you converted a polygon theme
to a point theme 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 point rather than as polygons. Second, you joined a point theme table and
a line theme table based on the Shape field. 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 themes.
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).
- Create a summary table (called age_cl.dbf) from the Stands
theme attribute table using the field Ag_cl_2001, and the statistic
Sum_Area (select Area as the Field, Sum as the
Summarize by statistic, and click the Add button).

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.
- Link (not Join) the Stands table (as the source) to
the age_cl.dbf table (as the destination) with Ag_cl_2001 as
the link field.
- Select the record in age_cl.dbf for 70-80 year old stands.
This selects all features in the Stands theme with the same value.
Note you could have performed this selection using a query, but you should
get familiar with this method of using summary tables and links.

- Make the Pack Forest view active, and also make the Stands
theme active.
- From the menu, choose Theme > Select By Theme. In the Select
By Theme dialog,
- Choose Stands in the selected features of pulldown.
- Select Are Within Distance Of in the Select features of
active themes pulldown.
- The Selection distance should be 0 (directly adjacent). Click
the New Set button.
|
|
Note that the order in which you select
from these dropdown lists is reversed
from the order in which they are
displayed on the dialog!! |
This creates a new selected set that has added to the selection any adjacent
polygons to the original selection (including the original selection).

- Now, unselect the 70-80 year old stands by using a query on the Stands
theme:
|
|
Make sure to click
Select From Set |
Now you have a selection of stands that are adjacent to the 70-80 year age
class, but not including the 70-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 2001). Estab_year
is the year of establishment for each stand. You will need to type in the
year value 1961.

- With the Streams theme active, select Select By Theme from
the menu. Make sure Streams is the active them because we are interested
in making a selection of streams.
- In the lower dropdown, select Stands.
- In the top dropdown, select Intersect.
- Choose New Set.

- Now reduce the selection of streams to only DNR Type 4 & 5, making sure
to Select From Set.

- To make the selected streams easier to see,
- Zoom to the selected streams
for better scaling.
- Make the Stands theme active, clear the selected set, and change
the color ramp to Blue monochromatic for greater color contrast.

What you see are type 4 and 5 streams that flow at least partially through
0-40 year old stands.
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 stems 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 theme.

- Make the Stands theme active. Because we are interested in making
a selection of stands, this is the theme to make active ("target"
theme).
- From the menu, choose Theme > Select By Theme. Find features of
the active theme (Stands) that intersect the selected features of Roads.
Click New Set.


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 view called Soils.
- Add the \packgis\forest\soils theme from the CD, as well as the Plot_centers.shp
from your Zip disk that were created earlier, to this new view.
- To make the different soil types visible, make a graduated color 6-class
natural break classification on the Windthrow.cd field in the Soils
theme table.
- Select moderate-to-high windthrow potential soil polygons. (New Set.)

- Make the Plot_centers.shp active. We are interested in selecting
plot centers, so we make this the active theme.
- Choose Theme > Select By Theme from the menu, and select plot
centers that are completely within the selected set of soils polygons. (New
Set.)

- To make the selected set of plot centers more visible, clear the selected
set of soil polygons.
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 Soils and Plot_centers.shp
are set to features with moderate-to-high windthrow potential.
- Add the Stands theme to the Soils view, and make sure the
theme is active.
- Choose Theme > Select By Theme from the menu, and select stands
centers that completely contain the selected set of plot centers.

- Turn off the Soils and Plot_centers.shp themes and turn
on the Stands theme.

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 theme. This is useful in determining if there is
a relationship between a point and a polygon themes. 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 theme-on-theme selections.
Here are a series of polygon-on-polygon selections as examples. Attempt each
one of these. The themes used are Soils (with a selection of moderate-to-high
windthrow polygons) and the Stands. In each case, the Soils is
the selector theme and Stands is the target theme. The type of relationship
is listed in bold.
|
|
Stands that
intersect
selected soils polygons,
Which probably overestimates the number of stands
|
|
|
Stands that
are completely within
selected soils polygons,
Which probably underestimates the number of stands
|
|
|
Stands that
completely contain
selected soils polygons
|
|
|
Stands that
have their centers in
selected soils polygons
|
|
|
Stands that
contain the centers of
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
theme-on-theme 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.
- Open the Soils theme table and make the Shape field active.
- Open the Plot_centers.shp theme table and make the Shape field
active.
- Click the Join button
. This will join the
Soils attributes onto the Plot_centers table. The Soils
attributes are assigned to the plot center on which the plot center lies.
- Clear all selected records, then make the Windthrow.cd field active,
and create a summary table called windthrow.dbf, with the Ave_Plot_area
summary statistic. This will create a new table with a record for each unique
windthrow code value, along with a summary value of the average plot area
for each windthrow value.

The new table will be added to the project. This table is a summary that was
made from a joined field. As you can see, in this way ArcView treats joined
fields as though they are integral parts of the table
- Make the Windthrow.cd field in both the Attributes of Plot_centers
table (source) and the windthrow.dbf table active. Make sure that the
windthrow.dbf table (destination) is active, and select Table >
Link from the menu.
- Now selections on the windthrow.dbf summary table are displayed
on the view. (Remember, you could perform these selections using a query,
but a link make the selections more efficient.)
You have just used the technique of performing a spatial join of a polygon
theme table onto a point theme table. This adds to the point theme 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 will require some tricky joining.
- Add the Streams theme to the current view.
- Join the Stands theme attribute table onto the Plot_centers.shp
theme attribute table with Shape as the relate field.
- Open the Stand theme table and make the Shape field active.
- Open the Plot_centers.shp theme table and make the Shape
field active.
- Click the Join button
This appends the attributes from the Stands theme to the CFI plot
centers with a spatial join. Each plot center is coded with the attributes
for the underlying stand polygon. We now know the forest type for each
plot center.
- Open the Streams theme table and make the Shape field active.
- Make the Plot_centers.shp theme table active, and verify that the
Shape field is still active.
- Click the Join button. This appends the stream attributes onto the
plot centers (the plot center gets attributes from the closest stream segment).
Now each CFI plot center is coded for the dominant species of the forest stand
in which the plot lies, as well as its distance from the nearest stream.
- Make the Species field active and click the Summarize button
to create the table species_distance.dbf.
- Add the statistics Ave_Distance and StDev_Distance.

- Sort the table based on the Ave_distan field.

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?
Spatial merge
Spatial data themes are frequently created to meet multiple criteria. While
this insures the greatest flexibility in use, the complexity of these data sets
is often greater than needed. Spatial merging, or aggregation, of themes is
used to simplify the structure and use of originally complex data sets.
For example, the Roads theme is composed of 239 individual segments,
each coded for different type, surface, use, etc. If a roads theme is needed
which is coded simply for surface type, it is possible to aggregate features
that share the same attribute.
Here, roads with the same surface type are aggregated.
- Create a new view and add the Boundary and Roads themes.

- Open the Roads theme table.
- Make the Surface (surface type) field active.
- Click the Summarize button, and place the output in the new
table road_surf on your zip drive (specified using the Save As button
or text control). Add the output fields Merge_Shape and Sum_Length.
This will create a new line shapefile, whose attribute table will be the summary
table you have just defined. The output shapefile will have lines merged together
that have the same value for Surface, and each feature will have an
attribute representing the total length of all roads with the same value for
Surface.

The Merge_Shape summary statistic is what performs the merging of features
with the same attribute value for the active field. Other summary statistics
may be added but they are not necessary. Although this is a tabular summary,
the Merge_Shape summary statistic creates an entire new shapefile.
- Place the new theme in a new view.

- The new theme is composed of only 4 features. Each feature represents a
unique value from the Surface field from the original Roads
theme.

As each different feature is selected, notice the attribute table shows the
surface type, number of input arcs, and total length. Also notice that multiple
line objects are merged into the same feature.
It is possible to simplify themes in this way. Beware that if you simplify
a theme, it is always at the expense of loss of detailed information. All original
attributes except, the field used for summation, are lost. Once simplified in
this way, a theme can not be restored to its original complex form.