Map Analysis with Vector Data

Prepared by Francisco Olivera, Ph.D., P.E. and Srikanth Koka

Department of Civil Engineering

Texas A&M University

August 8, 2004

Contents:

Brief Overview of Map Analysis

Goals of the Exercise

Computer and Data Requirements

Procedure:

  1. SelectingFeatures
  2. GeoProcessing Wizard
  3. Tabular Analysis
  4. Spatial Join
  5. Buffers

Brief Overview of Map Analysis

Map analysis consists of inferring information necessary for engineering/scientific tasks from general information contained in digital spatial datasets. In this exercise, analysis will be performed using vector data (points, lines and polygons).

Goals of the Exercise

Introduction to:

  • Selecting features
  • Geoprocessing tools
  • Tabular analysis
  • Spatial join
  • Buffers

Computer and Data Requirements

To carry out this exercise, you need to have a computer that runs ArcGIS 8.3.

You will be working with the following spatial datasets contained in 3 different folders, during this exercise:

Main Folder: VectorAnal

Folder 1: SelectFeats

texas_counties.shp containing the county features,

texas_rivers.shp containing the river features

Texas_roads.shp containing the road features

Folder2: GeoWizard

A: polygon dataset, B: polygon dataset, C: line dataset, D: point dataset, E: point dataset

In addition to geometric information (area, perimeter and length), the feature classes have the following fields:

AConc: Mass of a certain fertilizer per unit area (Kg/m2)(Intensive attribute)

ATrees: Number of trees(Extensive attribute)

BOwner: Land owner(Intensive attribute)

CName: Road name (Intensive attribute)

DRain: Annual precipitation depth (mm)(Intensive attribute)

ERain: Annual precipitation depth (mm)(Intensive attribute)

Folder3: TabAnal

CityInfo.dbf, dbf table containing population information of cities in Texas

TX_Cities.shp, point shapefile containing cities of Texas

TX_counties.shp, polygon shapefile containing counties of Texas

Procedure

1.Selecting Features

A.Selecting features manually

In this section of the exercise you are going to select features manually.

(1)Open ArcMap from the Windows Start menu.

(2)Add texas_counties.shp, texas_rivers and Texas_roads shapefiles (located in SelectFeats folder) to the data frame using the Add Data tool. Save the map document with a name of your choice. You will now select features from the texas_counties layer only. In order to select features from this layer only you have to choose the selectable layers.

(3)On the Selection dropdown menu of the ArcMap, click on Set Selectable Layers. Remove the check marks for all the layers except texas_counties and Close the wizard. You can also change the options for selecting features by clicking Options in the Selection dropdown menu.

(4)In the wizard that opens, take a look at the options and information given, but change only the selection color by going to the Selection Color tab. Here you should change the color from blue to red and click OK.

(5)Now that you have chosen the layer you want to select features from, and a color for selection, make sure that the toolbar containing the Select tool is visible. That is, make sure that the Tools toolbar is visible in the map.

(6)If it is not visible, click Tools/Customize on the Main Menu.Under the Toolbars tab, select Tools and click Close.

(7)To select only one feature, click on the SelectFeatures tool, , and then click on the feature you want to select. To select multiple features press the Shift key, and then using the Select tool, start clicking on all the features you want to select.

(8)You can now toggle the selection by right clicking on the texas_counties layer, pointing to Selection and clicking on Switch Selection.

(9)To clear the selections, click on Selection/Clear Selected Features.

B.Selecting features by attributes

Manual selection is useful when you know the locations of the features you want to select. Instead, if you have information about an attribute such as the names of the counties, you can use this information and define a query to select the features automatically.

In this section of the exercise you will select the county features whose names are Brazos, Carson, Parker, Reeves and Refugio using Select by attributes tool.

(1)Click on Selection/Select by Attributes. In the wizard that opens, choose texas_counties for Layer, and Create a new selection for the Method.

(2)In the Fields box, double-click on COUNTY_NAM so that the list containing all the county names appear in the Unique values box. To build the query, use the query window, which is titled “SELECT * FROM texas_counties WHERE:” You can type a query if you want, but it could be error prone; inserting a query by clicking on the buttons provided for building queries is a better idea.

(3)Now click on the equals (=) button and in the Unique values list, browse down to Brazos and double-click it.

(4)You should see a statement saying “COUNTY_NAM” = ‘Brazos.’ Up to this point, your query can select only one feature. To select all the other counties, create statements like the one described above, each separated by OR.

(5)To add the next statement, click the OR button and then double-click on COUNTY_NAM. Click on the equals (=) button and in the Unique values list, browse down to Carson and double-click it. Repeat this step for all the other three counties and your final query should look like: “COUNTY_NAM” = ‘Brazos’ OR “COUNTY_NAM” = ‘Carson’ OR “COUNTY_NAM” = ‘Parker’ OR “COUNTY_NAM” = ‘Reeves’ OR “COUNTY_NAM” = ‘Refugio.’

(6)Click Apply to select the features and click Close to close the wizard.

Take a look at the selected features on the map. Keep the selection as it is because it will be used in the next part of the exercise.

C.Selecting features by location

In this part of the exercise, you will select features based on location by following the directions below.

(1)Make the Texas_roads and texas_rivers layers visible. You will select the roads that share the same spatial location as that of the selected counties, i.e., in other words, you will select the roads and rivers that are contained by the selected counties.

(2)Do this by clicking Selection/Select by Location. A dialog titled, “Select by Location” opens. In the dialog, keep “select features from” as the option for I want to:.

(3)Choose “Texas_roads” and “texas_rivers” for the following layers:,choose “intersect” for that:,leave the option of “texas_counties” for the features in this layer:, let the check be inserted for Use selected features and then click Apply.

(4)Take a look the features. Close the wizard and make the texas_counties layer invisible so that you can look at the selected features clearly.

2.GeoProcessing Wizard

To utilize the functions of the GeoProcessing wizard, you will use the same data provided in the slides.

The five feature classes used in this analysis of the geoprocessing tools are:

A) a polygon dataset

B) a polygon dataset

C) a line dataset

D) a point dataset

E) a point dataset

A.Dissolving features

The Dissolve function creates a new feature class/shapefile in which all features that have the same value for a given attribute are aggregated into a single record. It applies to one dataset only; the user has the option of defining how attributes are recalculated. Before going into details on how to use the GeoProcessing wizard, add A.shp, B.shp, C.shp, D.shp and E.shp from the GeoWizard folder to a new ArcMap document and save the document.

B.shp defines the land that belongs to different people. Make all the layers invisible except B.shp. Right-click on B-layer and select “Label Features.” Notice that John and Melissa each have two separate parcels of land. In order to dissolve all the land that belongs to a person, you will have to use the dissolve function under the geoprocessing wizard. Do this by following the directions below.

(1)Click on Tools/GeoProcessing Wizard and select Dissolve features based on an attribute. Click Next.

(2)In the next wizard that opens, select B under Select the input layer to dissolve:, select BOWNER for Select an attribute on which to dissolve:,choose the working folder and enter B_Dissolve as the name for the output under Specify the output shapefile or feature class.Click on Save and then click Next.

(3)In the next wizard, double-click the word Area (or click the + box), check Sum,leave the remaining entries as they are and click Finish.

(4)Open the attribute tables of B and B_DISSOLVE, and note that the number of polygons have dropped from 9 to 7 by comparing records in the attribute tables of B.shp and B_Dissolve.shp.After dissolving the dataset, the key attribute (i.e., BOWNER) is copied, and two new attributes are created: Count_BOWNER – the number of polygons aggregated, and Sum_Area – the sum of the previous attribute Area (as requested in previous window).

You should see that in the attribute table of B, John and Melissa each have two rows. In the attribute table for B_Dissolve, they have only one. Select Melissa’s row in B-Dissolve and note that both polygons belonging to her are selected.

B.Merge layers

The Merge function creates a new feature class or shapefile from features of two or more feature classes or shapefiles, attributes of only one of the feature classes or shapefiles are retained, and attributes of the other feature classes or shapefiles are retained only if they have the same name. The user has the option of selecting the dataset whose attributes will be retained.

(1)Make all layers invisible except D and E. Change the symbology of these layers before merging them. Change the symbol of layer D to the type called “Square2.”

(2)This can be done by left-clicking on the layer and choosing Square2 in the Symbol Selector wizard.

(3)Similarly, change the symbol of layer E to the type called “Circle 2.” This can be done by left-clicking on the layer and choosing Circle 2 in the Symbol Selector wizard.

(4)You will now merge D.shp and E.shp so that all the precipitation stations are in the same dataset. Do this by clicking on Tools/GeoProcessing Wizard.A wizard opens where you should select Merge layers together and then click Next.

(5)In the next wizard that opens, select D-point and E-point under Select at least two layers to merge.Select D-point for Use fields from:,choose the working folder and enter D_Merge as the name for the output under Specify the output shapefile or feature class.Click Save and then click Finish.

C.Clip layers

The Clip function creates a new feature class by clipping an input feature class with another clipping polygon feature class. The attributes of the input feature class are not altered (including the geometry).

In this exercise, you are going to clip road features of C.shp using selected features of B_Dissolve. Before going into the process of clipping:

(1)Select John’s property by first opening the attribute table of B_Dissolve.

(2)In the field named BOWNER find John and select the record by clicking on the box located on the left most part of the record.

(3)In the Table of Contents change the order of the layers so that C is on the top and B_Dissolve is next. Make all the layers invisible except C and B_Dissolve.

You are now ready to go into the process of clipping:

(4)Click on Tools/GeoProcessing Wizard,then select Clip one layer based on the other. Click Next.

(5)Select C as the option for Select the input layer to clip:, choose B_Dissolve for Select a polygon clip layer:, let the Use selected features only option be selected, enter the name for new clip shapefile as C_Clip and specify where the output shapefile should be stored using the folder icon located for Specify the output shapefile or feature class.

(6)Click Save and then Finish.A new layer would be added to the data frame. To see features of only the new layer make all layers invisible except C_Clip.

D.Intersect layers

The Intersect function creates a new feature class/shapefile in which the features are the result of intersecting the features of an input feature class/shapefile with the polygons of an overlay feature class/shapefile. Resulting features have attributes from both feature classes/shapefiles. In this part of the exercise you will be intersecting A (input) and B (overlay) so that for each resulting polygon the mass of fertilizer per unit area and the owner are a unique combination of values.

(1)In ArcMap, make only layers A and B visible. If the layers have the same legend, change the legends so that they can be distinguished. Now you will intersect the layers.

(2)Click on the Tools/GeoProcessing Wizard andthen select Intersect two layers. Click Next.

(3)Select A as the option for Select the input layer to intersect:, choose B for Select a polygon overlay layer:, enter the name for the new intersect shapefile as “ABIntersect” and specify where the output shapefile will be stored using the folder icon located for Specify the output shapefile or feature class.Click Save and then Finish.A new layer will be added to the data frame.

E.Union layers

The Union function creates a new feature class/shapefile by combining the polygons of an input feature class/shapefile with the polygons of an overlay feature class/shapefile. The resulting dataset has the extent of both. Only 2 polygon datasets can participate in a union. Union is very similar to Intersect, but in Union the parts of the polygons that do not intersect have zero for the non-defined attributes.

In this part of the exercise you will union A (input) and B (overlay), so that for each resulting polygon the mass of fertilizer per unit area and the owner are a unique combination of values.

(1)In ArcMap, make only layers A and B visible. If the layers have the same legend, change the legends so they can be distinguished. You will now union the layers.

(2)Click on the Tools/GeoProcessing Wizard,then select Union two layers and click Next.

(3)Then select A as the option for Select the input layer to union:, choose B for Select a polygon overlay layer:, enter the name for the new intersect shapefile as “ABUnion” and specify where the output shapefile will be stored using the folder icon located for Specify the output shapefile or feature class. Click Save and then Finish.A new layer will be added to the data frame.

Keep this document open, as you will use it for the next section of this exercise.

3.Tabular Analysis

A.Joining tables

Joining tables consists of appending the attributes of a source table to a target table, where the records are related through key fields in each table. The tables do not necessarily have to be attribute tables.

In this part of the exercise you are going to join an attribute table (shapefile) with a stand-alone table. Here we are going to use the TX_Cities shapefile and the CityInfo table containing population information of the cities.

(1)Open a new ArcMap document using the Windows Start menu or by selecting the new file icon in the toolbar, . To the data frame in the new ArcMap document, add TX_cities.shp and CityInfo.dbf from the TabAnal folder using the Add Data tool. If the table is not visible in the Table of Contents, change the view from Display to Source.

(2)Open the attribute table of TX_Cities shapefile and open the CityInfo table. You should observe that the cities shapefile has 3 fields: FID, Shape*, and CITYNAME. The CityInfo table has 6 fields: OID, CITY_NAME, COUNTY, SIZE, POP_2000 and POP_1990. Here population is given in thousands. You will now join the fields of the CityInfo table to the TX_Cities shapefile using the key fields (i.e., CITYNAME from shapefile and CITY_NAME from the table).

(3)Close the tables and then right-click on the TX_cities layer, point to Joins and Relates,click on Join. In the Join Data window that appears, choose “Join attributes from a table” for What do you want to join to this layer?,select CITYNAME for Choose the field in this layer that the join will be based on:,let CityInfo be selected in the next dropdown, let the check mark be inserted for Show the attribute tables of layer in this list,choose CITY_NAME for Choose the field in the table that the join will be based on:,and click OK.

(4)To see the join, open the attribute table of the TX_Cities layer. You will see that the number of fields has increased. The join is temporary; it will vanish once you close the ArcMap document without saving it.