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 11: Spatial Analysis III: Finding Data that Meet Spatial Criteria--Select by Theme Tool and the Role of Distance

Another typical GIS task is to find places that meet certain spatial criteria, such as being located within a certain distance of another geographic feature or intersecting with another geographic feature.

We use the Select by Theme tool to select features that meet such spatial criteria.

Distance is a crucial variable in IPM because the spread of pests over time may be distance-dependent and the influence of environmental factors on pest populations may also be distance-dependent. Similarly, distance is important in a wide range of other agricultural variables. For example, the types of crops grown and agricultural intensity may be affected by distance to roads and markets.

Setting the Scale in ArcView

Before using Select by Theme and other distance-related tools, we need to be sure that we have set the units to be used for measuring distance.

We examined distance units briefly before in relation to Layouts, but here we will explore the issue more fully.

To do so, click on View in the menu at the top of the screen and select Properties from the drop-down list.

This brings up the View Properties dialog box.

Notice that in the middle of this dialog box there are two drop-down lists for "Map Units" (coordinate units) and "Distance Units."

"Map units" are determined when the digital data for the map were originally created. (They are related to the type of map projection used.) You need to make sure that they are entered correctly in the "Map Units" box here. For all the maps in our exercises, "Map Units" should be set to "meters." If you do not have "meters" selected in the "Map Units" box, select that choice from the drop-down list.

When you obtain GIS data from the National Biomass Project, you should set "Map Units" to meters in your View Properties. ArcView will not do this automatically.

If you add new themes from another source and are not sure of the View properties, always check the View Properties dialog box. If you find "Map Units" are in "decimal degrees," such data do not have the same properties as data from the National Biomass Project. In such cases, you need to project such data to the same properties as the National Biomass Project GIS data. Seek help from advanced users for projecting your data.

(For your information for future reference, here are the projection properties for data from the National Biomass Project and other data in this tutorial:

Whereas you must set Map Units to the appropriate unit, you have a choice in setting the "Distance Units".

The "Distance Units" determine what units will be illustrated in your map. For example, do you want your distance measurements in meters, miles, kilometers, etc.? The Distance Units chosen will depend upon the map's scale. The choices are illustrated below.

We will set Distance Units to "meters." Click on the OK button when finished.

Examining the Influence of Distance

When using distance tools, we can employ them for examining themes that are points, lines, and polygons.

For our example, we want to determine how the number of pests found in pest traps is influenced by distance from rivers.

First, uncheck the box next to "Quarter_acre+.shp" in the Table of Contents so that it is not displayed in our View.

Next, check the box next to "District Names" at the bottom of the Table of Contents so that it is displayed in our View. We are only displaying this theme to provide a background color to better view selected point data.

Add the theme "Newpest.shp" to the Table of Contents, display it, make it active, and zoom to the active theme. This theme has the data on pest counts in our pest traps. (Note: this map is from a different area of Iganga than that for "Shambas.shp".)

Create a graduated symbol map of "Newpest.shp" using data in the field "Pests_num" (number of pests).

Also, display the theme "Iganga-river_50000.shp." Your View should look like this:

We can now see the spatial distribution of pest traps and their counts in relation to the rivers. We want to know if those pest trap counts closer to the rivers have higher pest counts than do those farther away.

We are interested in selecting those pest traps on our map that are within a certain distance from the rivers. Those that are within the specified distance will be highlighted in yellow. Thus, the theme "Newpest.shp" must be active, as it is in our View.

It is important to remember that the theme whose features will be highlighted in yellow must be active.

Select from the menu at the top of the screen Theme and then Select by Theme... from the drop-down list.

The Select by Theme dialog box now appears.

Note that there are two drop-down lists under the headings "Select features of active themes that" and "the selected features of."

First, go to the second drop-down list "the selected features of." Click on the down arrow and notice the list of themes. Choose "Iganga-river_50000.shp" from the list. This indicates that distances will be measured from where the rivers are located.

(Note that this section concerns "the selected features of." We chose "Iganga-river_50000.shp" from the list. We did not select any rivers in this theme. Therefore, distance measures will be calculated from all rivers in the theme. But if we had selected a river, that is, highlighted a river in yellow, distance measures would be calculated only from the selected river, not from all the rivers.)

Now look at the first drop-down list, "Select features of active themes that". From this list, choose Are Within Distance of. Because "Newpest.shp" is the active theme, ArcView will find the points of this theme that are within a specified distance from the rivers.

(Note: depending on the themes chosen, the "Select features of active themes that" drop-down list can have numerous possibilities:

We will use several of these in this lesson.)

Your dialog box should now look like this.

Note also that a new category has appeared at the bottom of the dialog box, "Selection distance." This is where we enter the distance that we want to specify. Erase the zero and type in 50 because we want to select all points with pest-count data that are within 50 meters of a river.

(Note: distance units here are in meters because we set distance units to meters in the View Properties. If we had set the distance units to another unit in the View Properties dialog box--such as feet, kilometers, or miles--that unit of distance would appear in the Select by Theme dialog box.)

Now click on the New Set button at the right of the dialog box. The pest traps that are within 50 meters of a river will be selected and appear in yellow on the map. By default, ArcView represents selected features by depicting them in yellow.

Does the 50 meter distance from rivers have an impact on pest populations? That is, do those pest traps that are within 50 meters of a river have higher pest counts than do those farther away?

Our visual inspection of the spatial pattern suggests that this might be true, but we would want more precise calculations. We will examine these pest count data in more detail in calculations when we explore tables in ArcView in the next Step.

Remember that in a GIS we can examine spatial patterns among a variety of themes. Thus, we could add soil type or crop patterns to determine if these also influence the spatial pattern of pest counts. For example, we might find that distance from rivers is important in influencing pest counts only where we find "bean-maize" but not where we find "bean-banana." Or we might find that distance from rivers is only significant where we have low cropping densities but not high cropping densities. Similarly, distance may only be important in sandy loam soils but not in clay soils. Visual inspection of such patterns is often very useful in suggesting further research.

We could examine other issues using this method. For example, we could compare the number of male and female-headed households a certain distance from roads or the impact of distance from roads on agricultural productivity.

Note that we could convert the selected points into a new shapefile, as we discussed in the previous Step.

Remove the color yellow from the selected points by clicking on the Clear Selected Features button.

You can also select an individual feature of a point, polygon, or line theme, convert it to a shapefile, and take distance measurements from the feature in the new shapefile.

For our example, we will create a new shapefile from a selected parcel where a pest outbreak first occurred. We want to find all other parcels of land within a certain distance from this parcel where this pest outbreak first occurred. (Note that we can examine distances from polygons to other polygons.)

For example, let us say that we want to find all parcels of land within a certain distance from the parcel where a pest outbreak first occurred.(Note that we can examine distances from polygons to other polygons.)

Uncheck the boxes next to the themes "Newpest.shp," "Iganga-river_50000.shp," and "District Names" in the Table of Contents so that they are no longer displayed in our View.

Check the box next to the theme "Shambas.shp" so that it is displayed in our View, make it active, and zoom to the active theme.

First we need to select the parcel where the pest outbreak began. Click on the Select Feature button.

Select the parcel that I have selected in the map below (see cursor location). Assume this is where the pest outbreak started.

We want to convert this selected feature to a shapefile so that we can take distance measurements from it.

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.

Name our new shapefile "pest-origin.shp" and place it in the "ipm-crsp" directory.

Click on the OK button.

A window will appear asking if you want to "Add shapefile as theme to the view?" Select Yes.

Our new theme name, "Pest-origin.shp", now appears at the top of the Table of Contents.

Make sure that the theme "Shambas.shp" is active. Then, click on the Clear Selected Features button to remove the yellow highlighting in the parcel. Check the box next to the theme name "Pest-origin.shp" so that it appears on the map.

The theme "Shambas.shp" is active because we are interested in finding parcels in this theme a certain distance from the new polygon theme we just created, "Pest-origin.shp"--the place where the pest outbreak began.

Select from the menu at the top of the screen Theme and then Select by Theme... from the drop-down list.

The Select by Theme dialog box now appears.

First, go to the second drop-down list "the selected features of." Click on the down arrow and choose "Pest-origin.shp" from the list. This indicates that distances will be measured from this parcel.

Now look at the first drop-down list, "Select features of active themes that". From this list, choose Are Within Distance of. Because "Shambas.shp" is the active theme, ArcView will find the polygons of this theme that are within a specified distance from the parcel in "Pest-origin.shp".

For "Selection distance" enter 40, which indicates that we want to select parcels in "Shambas.shp" that are within 40 meters of the parcel where the outbreak started.

Click on the New Set button in the dialog box and the parcels whose closest boundaries are within 40 meters of "Pest-origin.shp" are now selected.

We could create a shapefile from these selected parcels. We could also examine their characteristics in the table for the theme (see next Step) and compare them with those of parcels farther away.

Finding Features Adjacent to Other Features

You can also select all the polygons that are adjacent to [share the same boundary with] another polygon or line. In this case, we want to identify all parcels that are adjacent to the rivers.

Remove the yellow highlighting in the map of "Shambas.shp". Also, uncheck the box next to the theme "Pest-origin.shp" so that it is no longer displayed.

Also, drag the theme "Iganga-river_50000.shp" above the theme "Shambas.shp" in the Table of Contents so that we can see the rivers on top of the parcels. Display the rivers. Make sure that the theme "Shambas.shp" is active because parcels adjacent to rivers will be highlighted in yellow.

As before, select Theme from the menu at the top of the screen and Select by Theme from the drop-down list.

In the Select by Theme dialog box , select "Iganga-river_50000.shp" for "the selected features of" drop-down list and "Intersect" for the "Select features of active themes that" drop-down list.

Note that there is no box for specifying distance here because we are focusing on features that are next to each other.

Click on the New Set button and all parcels adjacent to the river in our map will be highlighted in yellow.

We could then examine their agricultural characteristics and compare them with parcels farther away. We could also create a new shapefile from the parcels selected.

Also, if we were examining the impact of roads on agricultural production, we could select all parcels that are adjacent to roads in the same manner.

Click on the Clear Selected Features button to remove the yellow highlighting.

Distance-Based Buffers

We can use another feature of ArcView to examine distance relationships.

One important geographic concept relevant to agriculture is distance decay, which suggests that the intensity of the influence of a feature decreases as one goes farther away from that feature. For example, we would expect that the intensity of a pest outbreak would decrease as we get farther away from the source of the outbreak (We have examined this issue already in a basic fashion, but here we will use more complex methods.) Similarly, we might expect that agricultural intensity or agricultural incomes might decrease as we get farther away from market towns.

We can use ArcView to examine such spatial patterns.

We can create buffers, which are boundaries drawn around a feature at a specified distance from that feature. The boundary of a buffer creates a zone around the feature. We can create buffers around points, lines, and polygons. We can then examine the characteristics of other features located within each buffer zone to determine if their characteristics vary as distance from the feature increases.

Uncheck the boxes next to the themes "Shambas.shp" and "Iganga-river_50000.shp" so that they are no longer display in our View.

Make the theme "Newpest.shp" active, click on the zoom to active theme button, and display it in our View.

Add the theme "New-origin.shp" to the Table of Contents and display it in our View. Assume that this is where another pest outbreak started. Change the shape of the marker used to portray this theme to a triangle and change the size of the triangle to "20" to help distinguish it from the other points in "Newpest.shp".

Make the theme "Newpest.shp" active again.

Also check the box next to "District Names" at the bottom of the Table of Contents so that it is displayed in our View. We are only displaying this theme to provide a background color to better view selected point data.

We want to determine if the severity of the pest outbreak decreases with increasing distance from the origin point at "New-origin.shp." This is a classic example of the distance decay principle.

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

The Create Buffers dialog box appears.

Make sure that you select the same choices as in the above image. For the category "What do you want to buffer?" select "The features of a theme". In the drop-down list for "The features of a theme", select "New-origin.shp." Thus, we are going to create buffers around our point theme--"New-origin.shp."

Click on the Next button.

In the next dialog box, you are asked "How do you want to create buffers?" We want to select the third choice, "As multiple rings." This choice will draw a specified number of distance-based rings around "New-origin.shp."

Leave the choice for the "number of rings" as "3". For "distance between rings" enter the number "50". Note that in the category "Distance units are" that the units are set to "meters." Thus, we will create three rings around "New-origin.shp" that are each 50 meters wide.

Your dialog box should look like this:

Click on the Next button.

In this dialog box, you can select "Yes" for "Dissolve barriers between buffers."

For the choice, "Where do you want the buffers to be saved?" select "in a new theme." This choice will create a new theme based on the buffers. Note that you can select where you want to save the new theme. We can leave this choice as it is here, in our Work Directory "ipm-crsp."

Your dialog box should look like this:

Click on the Finish button.

The new theme, "Buffer 1 of New-origin.shp," is added to the Table of Contents on the left. We now have three distance-based buffers, each 50 meters wide, drawn around "New-origin.shp."

The problem now is that we cannot see the pest traps that we want to examine, as they are covered by the concentric rings of the buffers. But we can change the fill pattern of the buffer rings to make each of the rings in our new theme transparent, a technique that we learned in Step 6.

Double-click on the theme "Buffer 1 of New-origin.shp" in the Table of Contents to bring up the Legend Editor dialog box.

Change the fill pattern of each of the three color symbols in the Legend Editor.

Use different transparent or hatched fill patterns for each one in the Fill Palette. Also, change the "Outline" setting at the bottom of the Fill Palette to "2" for each one to make the outlines more distinct.

In the Color Palette, select a different "Foreground" color for each ring. Be sure that each color that you select contrasts well with the color portraying the theme "Newpest.shp." Then, in the drop-down list for the category "Color" select "Background." For the Background color select the "X" in the top left corner of the Color Palette.

Close the Palette window, click on the Apply button in the Legend Editor dialog box, and close the Legend Editor dialog box.

Your map should look something like this:

We can now clearly see the pest traps within each ring. How do we compare their characteristics to see if they change with increasing distance from "New-origin.shp," the point where the outbreak was first observed?

Remember that we can query our data to display only certain features that meet our criteria. We could create separate queries to display each ring separately and then conduct our analysis.

We will just create one query as an example.

Make sure that the theme "Buffer 1 of New-origin.shp" is active. Then click on the Theme Properties button at the top of the screen to bring up the Theme Properties dialog box.

Click on the Query Builder button in the Theme Properties dialog box to bring up the Query Builder dialog box.

Under the section "Fields" double-click on "BufferDis" (which stands for "buffer distance"). In the center of the dialog box, click on the "equal to" button. Under the "Values" section, double-click on "50," which represents our first distance-based ring.

Your dialog box should look like this:

This query tells ArcView to display only the buffer with the value equal to "50".

Click on the OK button. When the Theme Properties dialog box appears, click on the OK button as well.

Our map now displays just one ring.

We now need to be able to analyze all pest-count data that are located within this distance zone of 50 meters.

We can use another function of the same Select by Theme tool that we used earlier in this Step. We can use it to select points that are located within the boundary of any polygon. A buffer is an example of a polygon.

Be sure that the theme "Newpest.shp" is active because we will be selecting (highlighting in yellow) pest traps that are located within the buffer.

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

The Select by Theme dialog box appears.

Under the top section "Select features of active themes that," select from the drop-down list "Are Completely Within".

Under the section "the selected features of" select "Buffer 1 of New-origin.shp" from the drop-down list.

You dialog box should look like this:

These choices will select those pest traps that are completely within the remaining feature of our theme "Buffer 1 of New-origin.shp," which is the area up to 50 meters from our "New-origin.shp." This function thus enables us to select points that are found within a polygon theme.

Click on the New Set button.

Notice that the pest traps within this distance zone are now selected and highlighted in yellow.

Because these points are selected (highlighted in yellow) we can examine their characteristics in the associated table for this theme.

We could then repeat these steps for the pest traps that are in the area covered by the second distance-based buffer and again for those pest traps in the area covered by the third distance-based buffer. Finally, we could compare the pest-counts in each distance zone to determine if the intensity of the pest outbreak decreases with increasing distance from the origin of the pest outbreak.

We could also use this method to determine the rate at which the pest has spread over time. We could track the spread of parasitoids in the same manner. In addition, we could examine changes in farmers' knowledge about IPM strategies with increasing distance from IPM demonstration plots.

We will learn how to examine such characteristics of themes when we examine Database Tables in Step 12.

Note that we can also create buffers around both lines and polygons.

Other Methods of Determining Distance

There are other methods that we can use to find locations within a certain distance of a feature, especially those represented by a point.

Remove the yellow highlighting from "Newpest.shp" and make the theme active. Uncheck the box next to "Buffer 1 of New-origin.shp" in the Table of Contents so that the theme is no longer displayed in our View.

Your View should only display "Newpest.shp," "New-origin.shp," and the background color from "District Names."

Press (not just a click) on the Draw Point button on the far right of the second row of buttons at the top of the screen.

A drop-down list of icons will appear. Click on the icon near the middle that looks like a circle.

Then move your cursor to the triangle on the map representing "New-origin.shp."

Notice that the cursor changes to "cross-hairs" when moved over the map.

Place the cursor exactly on top of the triangle representing "New-origin.shp" and drag it outwards slowly. Notice that the status bar at the bottom left of the window indicates the length of the radius of the circle that we are drawing.

When the radius reaches approximately 150 meters, release the cursor and the circle will remain on the map, with four square, black "handles" outside its border.

To examine the characteristics of all the points within the circle that we have created, we can select those points by clicking on the Select Features Using Graphic button.

Click on this button and notice that these points are highlighted in yellow.

You can delete the circle (or any other graphic that you create, such as a line or polygon) from the map. Make sure that it is "selected," that is, you see the four "handles" outside the edge of the circle (as you can see in the map above). (Note: If the handles do not appear, click on the pointer arrow button on the second row of buttons at the top of the screen and then click on the edge of the circle in the map and the handles will appear.) Select Edit from the menu at the top of the screen and then select Delete Graphics from the drop-down list.

The circle is now deleted.

There is one more distance tool in ArcView that is useful. Click on the Measure button in the second row of buttons at the top of the screen.

When you place you cursor on the map, it changes to a cross-hairs with a ruler. Place your cursor on one point representing a pest trap and drag it to another point representing a pest trap on the map. As you do so, the distance measured appears in the status bar at the bottom left of the screen.

Double-click on the screen to remove the distance-measuring line.

Before discussing tables in ArcView in the next Step, uncheck the boxes next to the themes "District Names," "Newpest.shp" and "New-origin.shp" in the Table of Contents so that they are no longer displayed in our View.

Display the theme "Shambas.shp," make it active, and zoom to the active theme.

[Return to beginning]

[GO TO STEP 12]