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

 

  1. Open a map document
  2. Create an event layer from polygon centroids
  3. Selecting points near a line
  4. Selecting adjacent polygons
  5. Line-on-polygon selection
  6. Polygon-on-line selection
  7. Point-in-polygon selection
  8. Polygon-on-point selection
  9. Polygon-on-polygon selection
  10. Spatial join: containment (inside)
  11. Spatial join: proximity (nearest

 


Open a map document

  1. Create a directory in your personal directory called v_an_1.

  2. 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.



  3. Download the map document v_an_1.mxd, and save it in this directory.

  4. 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.

  1. 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.

  2. Open the attribute table for the new cfi shapefile.

  3. 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.

  4. Add a field called y_coord to the table (Options > Add Field), following this format:



  5. 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.

  6. 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.

    1. If you get the following error message, proceed with this fix, otherwise skip to adding Y-coordinate values.



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



    3. Check the Advanced box and re-enter

      dblX




  7. Do the same for the y_coord field:

    Dim dblY As Double
    Dim pArea As IArea
    Set pArea = [Shape]
    dblY = pArea.Centroid.Y

    dblY




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



  9. 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).



  10. Close the table.

  11. 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.

  12. Click the Edit button for changing the coordinate system of the new points.



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



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



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



    Click OK to add the points to the map



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



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





  18. 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)

  1. From the Selection menu, choose Select By Location.



  2. 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:



  3. 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)

  1. Right-click the cfi_centroid_points layer and select Joins and Relates > Join.

    1. In the first dropdown, select Join data from another layer based on spatial location.

    2. 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.

    3. Specify the output as v_an_1\cfi_spatial_join_streams.

    4. Click OK.



  2. 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.



  3. 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.



  4. 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?

  5. Make a selection based on the Distance field:



  6. 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.

  7. 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).

  1. Open the Stands attribute table. Right-click the AGE_CLASS_2003 field and select Summarize.

  2. 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.



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



  4. 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.

  5. Next, perform a spatial selection to get stands that are adjacent to the currently selected set. From the menu, choose Selection > Select By Location.



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



    Apply and Close the dialog.

  7. 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.



  8. 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.



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



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



  11. 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?

  1. 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.



  2. 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.

  3. 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.



  4. 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?

  1. Select all tertiary roads with a query on the Roads layer. Make sure to use the Create a new selection method.





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



  3. 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?

  1. Create a new data frame called Soil Data.

  2. Add the L:\packgis\forest\soils as well as the v_an_1\cfi_centroid_points.shp (created earlier) to this new data frame.

  3. 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.



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



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



  6. 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?

  1. Make sure your selected sets for cfi_centroid_points are set to features with moderate-to-high windthrow potential from the previous section.

  2. Copy the Stands layer from the to the Pack Forest data frame Soil Data data frame.

  3. Use Select By Location to select stands that completely contain the selected set of plot centers.



  4. You can see how the overlapping stands are selected.



  5. 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.

  1. 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.

  2. 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.



  3. 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).

  4. 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.



  5. Perform a relate between the summary table and the points:



  6. 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.

  1. Add the Streams layer to the current data frame.

  2. 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.

  3. Now join Streams onto the output of the last join:



  4. Open the table for the output of this join and summarize the table based on the SPECIES field, with the summary statistic DISTANCE > Average.



  5. 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

 

  1. Open a project
  2. Set the working directory
  3. Open ArcToolbox
  4. Append
  5. Clip
  6. Identity
  7. Union
  8. Intersect
  9. Create a Geodatabase
  10. Update
  11. Erase
  12. Buffering
  13. Model Building


Open a project

  1. Make a directory in your personal directory called v_an_2 to store today's data.

  2. Download the project v_an_2.mxd, and save it in the new directory.

  3. Open the map document in ArcMap.


 

 


Set the working directory
  1. 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
  1. Open ArcToolbox by clicking its button .

  2. 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.

  1. 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.

  2. Unzip the zipfile.

  3. Create a new data frame.

  4. Add the two layers (sections_north and sections_south) and the Pack Forest boundary.

  5. Change the display color for either the north or the south sections in order to see the difference between the data sets.



  6. 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.



  7. 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.]



  8. 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.

  9. After the process is complete, you can close the dialog.



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



  11. 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.



  12. 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.

  1. 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.

  2. Extract the file to v_an_2 after you download it. This will give you a shapefile called culv_inv.

  3. 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.

  4. Create a new data frame and change its name to Culvert Inventory. The new data frame will automatically be active.

  5. 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.

  6. 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.

  7. Change the symbology of the culv_inv shapefile by opening the layer's properties and selecting the Symbology tab.

  8. 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.





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





  10. 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.

    1. The Input Features (that is, the features you want to clip) is CULV_INV.
    2. The Clip Features (that is, the "cookie cutter") is the Boundary.
    3. Enter the name of the Output Feature Class as v_an_2\CULV_INV_Clip_boundary.shp.



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



  12. The new layer will contain the same zones, but will be clipped down to the same overall spatial extent as the entire Forest.



  13. 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.

  1. Collapse the Culvert Inventory data frame and make the Topology! data frame active, and turn on only the Nwi and Stands layers.

  2. Open the attribute tables for Nwi and Stands. Note the field names and the values present.

  3. 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.

    1. The Input Features are the Nwi polygons;
    2. Set the Identity Features to Stands;
    3. 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.



  4. Close the dialog after the process finishes.



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



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





  7. 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.



  8. 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.

  9. 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



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

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



  10. 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




  11. 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.

  1. Open Analysis Tools > Overlay > Intersect.
    1. Again, select NWI and Stands as the Input Features .
    2. The Output Feature Class can be called anything you like, but I suggest using v_an_2\nwi_stands_Intersect.shp.



  2. 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.



  3. 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.

  1. Open ArcCatalog and navigate to the v_an_2 directory.

  2. Select File > New > Personal Geodatabase.



  3. 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.

  1. In ArcToolbox, open the Union tool. Like Intersect, the order of input and overlay does not matter.

  2. In ArcMap, use the <CTRL> key and select both the Soils and Stands layers. Drag these into the Features control in the Union tool.



  3. 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.



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



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



  6. 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.



  7. 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.

  1. Add the L:\packgis\forest\lakes layer to the data frame.

  2. Open the Update tool from ArcToolbox.
    1. Drag Soils from ArcMap into the Input Features control.
    2. Drag lakes polygon to the Update Features control.
    3. Browse to the geodatabase and set the name of the new data set to soils_updated_with_lakes.



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



    5. 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).



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



    7. 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?



    8. 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.

  1. Open the Erase tool.
    1. The Input Features is set to Soils.
    2. The Erase Features ("cookie cutter") is lakes polygon.
    3. Place the output in the geodatabase as soils_erased_with_lakes.



  2. 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.

  1. Create a new data frame called Road Buffering.

  2. Add the Roads layer this data frame.



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



    5. Add the table to the map.



    6. Open the table.



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



    8. 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.



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



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



    11. 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.



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



      3. 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.



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



      5. 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.

  1. First, convert the soils, stands, and roads to the geodatabase.
    1. Open the tool Conversion Tools > To Geodatabase > Feature Class to Geodatabase (multiple).
    2. Drag each of these, one at a time, from L:\packgis\forest\ into the dialog from ArcCatalog
      1. roads\arc
      2. soils\polygon
      3. stands\polygon
    3. Set the Output Geodatabase to the one you have been using (v_an_2\v_an_2.mdb).



    4. Click OK. After a few moments the process will complete.

    5. Right-click in ArcToolbox and select New Toolbox. Change the new toolbox name to your name.



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



    7. The new model will open.



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





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



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



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



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



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



    14. Scroll down and set the Dissolve Type to All.



      This parameterizes the buffer tool so that it will use these settings during run time.

    15. Open the Clip tool to parameterize it as well.
      1. The Input Features is the output of the Intersection.
      2. The Clip Features are the road buffers.
      3. Set the Output Feature Class to soils_stands_clipped_by_50_ft_road_buffer.





    16. The Intersect tool does not need to be parameterized because there is no order of precedence for intersection.

    17. Click the Auto Layout button and the Full Extent button to get a better view of the model.



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



    19. Now the model is ready to run. Click the Run button .

    20. 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.



    21. 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).



    22. 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.




    23. Also summarize the soil name field:







    24. 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.





    25. 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