IPM CRSP UGANDA

GIS WORKSHOP

USING ARCVIEW

Larry Grossman

Department of Geography - Virginia Tech


Held at Makerere University, Kampala, Uganda
February 19 - 21, 2002


VIRGINIA TECH
MAKERERE UNIVERSITY
NATIONAL AGRICULTURAL RESEARCH ORGANIZATION


NOTE: The materials on these pages--in printed and digital form and on the World Wide Web--are to be used only in association with the Virginia Tech IPM CRSP. Reproduction or use of these pages, in part or in full, for commercial purposes is strictly prohibited. Those wishing to reproduce or use these pages for non-profit, educational purposes should contact the author at LGROSSMN@VT.EDU for permission.


Acknowledgments: The digital data in these GIS lessons are supplied by the Institute for Environment and Natural Resources, Makerere University, Uganda; the National Environmental Management Agency (NEMA), Kampala, Uganda; the National Biomass Project, Department of Forestry, Kampala, Uganda; the World Resources Institute (African Data Sampler), New York; the Blackland Research and Extension Center and the Department of Rangeland Ecology & Management, Texas A & M University (Almanac Characterization Tool); and the United Nations.

Step 10: Spatial Analysis II: Selecting Features and Creating Shapefiles

Selecting Features

When we select a feature or features on a map, ArcView highlights those features in yellow. We can select a feature or features manually by clicking on them or by using tools in ArcView. We can also create queries or equations that enable ArcView to select those features that meet the criteria that we specify.

When we select features, we can find out information about those features by examining the database tables, because the rows of data associated with the highlighted features will also appear in yellow in the database tables. We will examine tables in Step 12.

It is important to remember that when you select features of a theme, any subsequent analyses performed on that theme will only examine the selected features, not all the features in that theme. To examine all the features in a theme, you must clear the selection by removing the yellow highlighting.

Also, when we select features of a theme, we can create a new shapefile based on those selected features. Producing such shapefiles is useful for creating a permanent record of your selection and in performing subsequent analyses

Double-click on the theme name "Main Crops" in the Table of Contents and create a "Single Symbol" legend map, which has a uniform color. Change the name of the theme back to its original name, "Shambas.shp."

We can now select features from this theme. The reason that we did not want to use the original map of "Main Crops" for selecting features is that the category "Bean-Banana" is represented in a color close to yellow, which is what ArcView uses for selecting features. The colors are too similar to distinguish between them in this printed GIS manual.

Selecting Features Manually

One way to select a feature is to click on it.

Make the theme "Shambas.shp" active. Click on the Select Feature tool in the second row of buttons at the top of the window.

Now click on the parcel that I have selected in the map below (see cursor arrow). It will turn yellow.

When you select a feature or features of a theme, they will turn yellow.

You can select more than one feature with this method. Hold down the "Shift" key on your keyboard while clicking on the features.

Remove the yellow highlighting so that no feature is selected. You remove the yellow highlighting by clicking on the Clear Selected Features button.

Your map should now have no features selected.

We now want to use another method for selecting more than one feature.

You can select features by drawing shapes on a map. We will draw a line to select features. Selecting features in a line is useful when employing transects in our research.

Press (not click) on the Draw Point button in the second row of buttons at the top of the screen.

A drop-down set of drawing icons will appear.

Select the Draw Line button from the drop-down set of drawing icons. This is the second icon in the drop-down set of drawing icons, as illustrated in the image above.

Then drag your cursor to create the line. Release it when finished.

Click on the Select Features Using Graphic button in the top row of buttons.

This button enables you to use the graphics that you create to select features for analysis. ArcView will then highlight all features (in this case polygons, but they could also be points and lines) intersected by the line.

You can remove the line on your map by pressing the "Delete" key on your keyboard if you see "handles" around the line. If you do not see "handles" around the line, click on the pointer button in the second row of buttons.

Then click on the graphic (in this case, a line) so that "handles" appear around the graphic. Then press the "Delete" key on your keyboard, and the graphic will be removed.

Also, remove the yellow highlighting, as we did above.

Uncheck the box next to the theme "Shambas.shp" in the Table of Contents so that the theme is no longer displayed.

Display the theme "Pests1.shp" and make it active.

We are now going to use a circle to select features.

When you draw a circle and then click on the Select Features Using Graphic button, ArcView highlights in yellow all features touching and within the circle.

Click on the Draw Circle button in the drawing icons found in the drop-down set.

Drag your cursor on the map to create a circle.

Notice that in the status bar in the bottom left of the ArcView window, the size of the radius of the circle (100 meters) that you have drawn is listed. Thus, you could draw the circle a certain radius to find all point data within a certain distance of the center.

Now click on the Select Features Using Graphic button.

All points within the circle are selected.

We could then examine the characteristics of these points and compare them with those of points outside the circle.

Remove the yellow highlighting by clicking on the Clear Selected Features button.

Also remove the circle that you have drawn on your map.

Uncheck the box next to "Pests1.shp" in the Table of Contents so that it is no longer displayed on your map.

Display the theme "Shambas.shp" and make it active.

Selecting Data by Querying

You can also select features that meet the criteria that you establish in a query.

For this purpose we use another Query Builder tool located in the top row of buttons below the menu.

When we create a query with this tool, ArcView selects (highlights in yellow) all those features of a theme that meet the criteria that we specify, but allows all other unselected features to remain on the map.

Note that this differs in function from the Query Builder we used in the Theme Properties dialog box. When we used that query builder, only those features that met the criteria that we specified remained on the map, but they retained their original shadings. No feature was highlighted in yellow.

Click on the Query Builder tool located in the top row of buttons below the menu, as indicated in the picture above.

The Query Builder dialog box appears, which looks somewhat similar to the Query Builder dialog box we used in the Theme Properties dialog box in the previous Step.

Assume that we want to compare parcels of land at least one-quarter acre (1/4 acre) in area with those smaller in area to see if their characteristics differ.

Using this Query Builder dialog box, create a query for the theme "Shambas.shp" that selects only parcels equal to or larger than one-quarter acre (1/4 acre) in area. The area of a parcel is found in the field "Acres."

In the "Fields" section, double-click on "[Acres]." In the upper-middle section of the dialog box, click on the operator button "greater than or equal to" . In the "Values" section, double-click on "0.25".

Your Query Builder dialog box should look like this:

If your equation is correct, click on the New Set button. Then close the Query Builder dialog box.

Those parcels with areas equal to or larger than 0.25 acres are now highlighted in yellow.

Using this tool in querying allows us to examine the differences between those features that do meet our criteria and those that do not.

How would you analyze such differences in features in a field using this query builder? You can use the Switch Selection button in a themes' attributes table that we will employ in Step 12.

Creating a Shapefile from Selected Features

We are going to create a new shapefile from the selected features of "Shambas.shp" in our View.

(Note for advanced users: You can create a shapefile from selected features of a theme only if the "Shape" field is checked as being visible in the Table Properties box.)

Go to the menu at the top of the screen and select Theme and then Convert to Shapefile from the drop-down list.

The Convert Shambas.shp dialog box appears.

Here you are asked to give the shapefile a name and to determine in which directory you want to store the shapefile.

First, select the directory in which you want to store the new shapefile. I will store it in our Work Directory, "ipm-crsp." Change the shapefile name to "Quarter_acre+.shp".

Click on the OK button.

The Convert to Shapefile window appears asking if you want to "Add shapefile as theme to the view?"

Select Yes.

Our new theme name, "Quarter_acre+.shp", now appears at the top of the Table of Contents.

Clear the selected features in the theme "Shambas.shp" and uncheck the box next to its name in the Table of Contents so that it is no longer displayed in our View.

Display only the new theme "Quarter_acre+.shp".

We now have a new theme consisting only of parcels equal to or larger in area than 0.25 acres. Such a new theme would be useful if we were going to only examine parcels of that minimum area in our research.

There are numerous reasons for creating such new shapefiles from queried data.

You could display this theme on top of other themes with parcels to highlight its location.

Sometimes we have very large data sets and only need a small portion for our analysis. For example, we might have a data set for all of Africa, but only want data for Uganda.

By converting one feature in a theme to a shapefile, we can take distance measurements from the new theme. For example, if a pest outbreak first occurred in one parcel (or one village in a different map), we could create a separate shapefile of that parcel (or village). We could then examine parcels at varying distances from the parcel where the pest outbreak first occurred to understand how the pest outbreak has spread through the area over time. We will learn to accomplish such tasks in the next Step.

Note that we can also create shapefiles from the features selected in the Query Builder dialog box in the Theme Properties dialog box.

We will use another method to select data in the next Step. Remember that any selected features can be converted to shapefiles.

[Return to beginning]

[GO TO STEP 11]