Lab 9 Geoprocessing
Lab 9 Geoprocessing
Lab 9 Geoprocessing
What Youll Learn: to apply the concepts of buffering and overlay, two common
cartographic operations. In Part II, you will work on a practical problem to develop a
deeper understanding of Geoprocessing.
Data: All data are in \L9 folder and Part 1 subdirectory, including lakes.shp, roads.shp,
and public lands in public_Hugo.shp. All distance units are meters.
What Youll Produce:
In Part 1, Three maps, 1) map of lake variable distance
buffer zones, 2) map of suitable recreation areas, and 3) map of suitable recreation
areas on private land only.
Variable Buffers
Another variation on buffering will change the buffer distance depending on feature
attributes (see the figure, below).
A GIS project may require buffering those lakes to map a minimum distance from shore
for installing septic systems. However, the acceptable distance for septic systems may
depend on lake size. A large lake could have a system within 100 meters of lakeshore,
but a small lake needs a setback of 25 meters.
A variable distance buffer could buffer the lakes coverage by using an attribute that
specifies the size class. Different sized buffers would be applied to each lake
depending on the size class attribute.
You will create a variable distance buffer in this lab, with the buffer distance defined by
lake size.
Variable distance buffering requires some way of specifying the
distance. This is most often done with an attribute in a table. The
buffering operation uses the table entry to determine buffer
distance around a feature. A numeric data item must be created
to specify the buffer distance, as shown in the column named
DIST in the table to the right. Each lake with an attribute for
surface of 1 will be assigned a buffer with distance 100, a surface
value of 2 a buffer distance of 50, and a surface value of 3, a
buffer distance of 25. Examples of lakes with the three different
surface values and resulting buffers are shown in the figure
above.
Surface
1
2
3
DIST
100
50
25
The displayed window (an example in the figure below) allows you to create a buffer
layer derived from an Input feature layer in a manner you specify.
Redo this buffer, but this time; leave the default Dissolve Type to NONE. How do the
results differ? When would this be important? After inspecting, remove the undissolved
layer.
Creating a Variable Distance Buffer
The second exercise will buffer the Lakes.shp layer using a variable distance buffer.
The buffer distances are:
A buffer distance of 50 meters for lakes with size class 1
A buffer distance of 150 meters for lakes with size class 2
A buffer distance of 500 meters for lakes with size class 3
3
Make sure the Lakes.shp is in your project, and open the attribute table for Lakes.
Left click Options Add field, and create a new long integer field named buffdist,
something descriptive.
Use the Select by Attributes to select each of the lake size classes. Assign the
appropriate buffer distance to each lake size class, placing the value in the newly
created field. Refer to the Lab 7 in this series if you dont remember how to
calculate/assign fields.
Close the table. Make sure you unselect any selected polygons or the buffer will only
work on selected polygons (before switching out of the table, click on the Selection
Clear All Selected Features).
Your table should appear similar to that shown below.
Before we overlay the two layers with the Union command, we need one more
preparation step. The lake buffers layer we created has buffered areas that include the
lake as well as the land near shore. We only want campsites on dry ground so we will
erase the lake from the lake buffer layer.
Note: Student Home versions of ArcGIS 10 do not have ERASE. This is a ArcEditor
version, with a one-year time out. Some functions are missing, including Erase, the
ability to work with topology, and others.
If you do have the Erase function (only in the ArcInfo version of ArcGIS located in Skok
35 or Green 210A labs), perform the following steps.
First, open the ArcToolbox, then Analysis Tools Overlay Erase
Specify Input Features as the variable lakes buffer
Specify the Erase Features as the lakes layer
Set the output destination in the output feature class
OK to apply the buffer
Workaround:
If you dont have the Erase
function in your toolbox, do
the following:
Open the table of the file that
will be used as the eraser, in
this lab this file is the Lakes
Add a short integer field to the lakes file, call it something like to_erase.
Use the Field Calculator (right click on column heading) to assign a value of 1 to all
records in this new to_erase column.
Use ArcToolbox Analysis Tools Overlay Union to union the erasing layer
(Lakes.shp) and the target (Var_Lakes_Buffer.shp) files
Open the attribute table of the unioned layer. Select by Attributes all records toerase is not equal to 1; for example to_erase <> 1,
Leave the records selected.
Select the unioned layer and Data Export Data, name the output
outside_lake_buffer.
End Workaround
7
Close the attribute table, make sure the Union_Lk_Rd layer is selected and right
click on the layer name in the TOC. Right click on the Union_Lk_Rd layer in the
table of contents, and select Data Export Data and export only the selected
(where in_both =1) to a file called Acceptable_Areas.
11
PART 3
Create a new project or data frame, and add the layers roads.shp, Lakes.shp,
acceptable areas.shp, and Public_Hugo.shp (see figure below).
Open the
ArcToolbox, then
Analysis
Overlay
Erase
Remember, if you
have the ArcMap
Student (or
ArcView) edition,
you do not have
the Erase tool, and
should use the
Workaround
described earlier.
From the
acceptable
areas layer,
use the Public_Hugo as the Erase Features Layer. This removes the publicly owned
land in Hugo from your Acceptable Areas.
Name you new layer; in the Output Feature Class to
Campgrounds_on_Private_Land. This is the land that would need to be acquired if
the community wants to build campsites.
12
Label each layer with descriptive text in the legend, and include a scale bar, north
arrow, and title.
Make sure you add the area measurement of the suitable for campground on private
land, in hectares.
Print or Export a map from this layout, your third and final map for this lab.
13
Part II
SOLVE A PRACTICAL PROBLEM
14
At the bottom of the window, notice the default geodatabase for this map is currently set to
C:\Users\gistrain\Documents\ArcGIS\Default.gdb. The default geodatabase should be set to the
geodatabase that will contain most of the data for the particular map document you are working
on. In this case, you will want to use the geodatabase in your GeoprocessingTutorialData folder.
3. Next to the Default geodatabase for this map: box, click the Browse button.
Ensure that the GeoprocessingTutorialData folder is highlighted in blue and not the
GeoprocessingData.gdb geodatabase that appears inside it. You never want to connect directly to
a geodatabase, as doing so will prevent you from being able to access any of the data contained
inside of it.
6. For Folder:, verify that GeoprocessingTutorialData folder or the is listed and
click OK.
7. In the Default Geodatabase window, select the GeoprocessingData.gdb
geodatabase and click Add.
8. Ensure the Default geodatabase correctly mentions GeoprocessingData.gdb
and click OK.
15
At this point, it is a good idea to save your map document and to continue saving regularly.
9. On the Standard toolbar, click the Save button.
10. In the Save As window, use the Save in: drop-down box to select the
GeoprocessingTutorialData folder.
You will save the map document here, directly inside the GeoprocessingTutorialData, but NOT
within the GeoprocessingData geodatabase.
11. For File name:,
Remember that, in order for your GIS project to open properly on other computers, you must tell
the map document to store relative pathnames to its data sources and take your entire project
folder containing all of your data and your map document with you.
12. Click the File menu and select Map Document Properties.
13. Towards the bottom of the Map Document Properties window, click the checkbox
to Store relative pathnames to data sources and click OK.
14. On the Standard toolbar, click the Save button again to store this setting in your
map document.
Merge
The first set of data you will be working with contains the HPD beat boundaries. Though it has
been modified for the purposes of this tutorial, the original data can be obtained from the City of
Houston GIS Database webpage, at http://cohgis.houstontx.gov/cohgis2010/index.html, within
the administrative boundary dataset.
1. On the right side of the ArcMap window, click the Catalog tab.
2. On the Catalog toolbar, click the Go To Default Geodatabase button, which will
take you to the default geodatabase you specified earlier.
16
Notice that the police beats in the City of Houston have been divided into two separate feature
classes covering the northern and southern portions of the city respectively. You will now
examine their attribute tables.
6. In the Table of Contents, right-click the HPDBeats_North layer and select Open
Attribute Table.
Notice that you are provided with both the beat number and the district number for each police
beat and that there are 55 beats in the north layer.
7. In the Table of Contents, right-click the HPDBeats_South layer and select Open
Attribute Table.
Notice that the south layer contains 62 beats with the same data fields.
8. Close the attribute tables.
At this point, you wish to combine the north and south police beats into a single layer. You will
do so using a geoprocessing tool in ArcToolbox.
9. On the Standard toolbar, click the ArcToolbox button.
10. Drag the blue title bar of the ArcToolbox window and notice the four blue
outward facing arrow buttons at the center of your screen.
11. Hover your cursor over the arrow pointing left towards the Table of Contents and
release to dock ArcToolbox in between your Table of Contents and your Map
Display.
12. If desirable, resize the widths of your Table of Contents and ArcToolbox.
13. On the Tools toolbar, click the Full Extent button.
14. In ArcToolbox, double-click the Data Management Tools toolbox > General toolset
> Merge too .
15. In the bottom right corner of the Merge window, click Show Help >>.
17
Read the Merge window help and review the sample illustration. Notice that this tool merges
two like datasets covering different geographic extents together in a single dataset.
16. In the Table of Contents, select the HPDBeats_South layer.
17. Hold down Shift and select the HPDBeats_North layer, so that both layers are
simultaneously selected.
18. Drag both selected layers into the Input Datasets box in the Merge window.
Usually, it takes a few moments for the tool to begin executing. While the tool is running, you
will notice scrolling text with the name of the running tool in the bottom right corner of the Map
Display, as shown below.
When the tool is finished running, you will see a box pop-up in the bottom right portion of your
monitor with the name of the tool. A green checkmark indicates that the tool ran successfully.
20. In the Table of Contents, right-click the HPDBeats layer and select Open Attribute
Table.
Scroll down the attribute table and notice that the attributes for both the north and south beats
feature classes were preserved and combined into a single table with 117 beats.
21. Close the attribute table.
Since you now have all the beats contained in a single layer, you no longer need the separate
layers for the north and south beats.
22. In the Table of Contents, right-click the HPDBeats_North layer and select Remove.
23. In the Table of Contents, right-click the HPDBeats_South layer and select Remove.
24. On the Standard toolbar, click the Save button.
18
Dissolve
As explained in the tutorial introduction, the collaboration with the schools is going to be based
on the police districts, not the police beats. At this point, your HPD layer only displays the police
beat boundaries, but its attribute table does tell you the district number corresponding to each
beat.
1. In the Table of Contents, right-click the HPDBeats layer and select Open Attribute
Table.
Scroll down the attribute table while observing the values in the District field. Notice that each
district contains many beats. You will now dissolve the police beats based on this District field
so that all beat boundaries within a single district will be dissolved into a single district
boundary.
2. Close the attribute table.
3. In ArcToolbox, under the Data Management Tools toolbox, double-click the
Generalization toolset > Dissolve tool.
Read the Dissolve help and review the sample illustration. Notice that this tool dissolves
boundaries based on common field values. In this case, you will dissolve the police beat
boundaries based on common district values, resulting in a file showing only the larger district
boundaries.
4. For Input Features, drag in the HPDBeats layer from the Table of Contents.
5. For Output Feature Class, rename the feature class from HPDBeats_Dissolve
to HPDDistricts.
6. For Dissolve_Field(s), check the District field, since this is the field containing
the common district values you wish to dissolve on.
7. Click OK.
8. In the Table of Contents, toggle the new HPDDistricts layer off and on to get a
better idea of the result of the Dissolve tool.
9. In the Table of Contents, right-click the HPDDistricts layer and select Open
Attribute Table.
Notice that only the dissolve field, in this case the District field, was preserved. Because multiple
beats were dissolved into each district, it is not possible to retain all of the attributes of each
separate beat.
10. Close the attribute table.
Since you only need to use the police districts, you may now remove the police beats layer.
19
11. In the Table of Contents, right-click the HPDBeats layer and select Remove.
12. On the Standard toolbar, click the Save button.
Clip
Now you will examine the school district boundaries. Though it has been modified for the
purposes of this tutorial, the original data can also be obtained online from the City of Houston
GIS Database webpage at http://cohgis.houstontx.gov/cohgis2010/index.html within the
administrative boundary dataset.
1. On the right side of the ArcMap window, click the Catalog tab.
2. Drag the HISD feature class into the Map Display.
Notice that this feature class displays the boundary of the Houston Independent School District,
which can be considered the study area boundary for this project. All of the other data layers you
bring into your map document can be clipped to the study area boundary to reduce the size of the
files you are working with, which will eliminate visual clutter and allow various processes to run
more quickly. First, you will clip the police districts to the study area boundary.
3. In ArcToolbox, double-click the Analysis Tools toolbox > Extract toolset > Clip
tool.
Read the Clip window help and review the sample illustration. Notice that this tool clips one
dataset to the extent, or shape, of another dataset.
4. For Input Features, drag in the HPDDistricts layer from the Table of Contents.
5. For Clip Features, drag in the HISD layer from the Table of Contents.
6. For Output Feature Class, rename the feature class from HPDDistricts_Clip to
HPDDistricts_HISD and click OK.
Notice that the resulting HPDDistricts_HISD layer maintains the police district boundaries, but
limits the extent of the districts to the extent of the HISD boundary. You no long need the full
police districts layer and may remove it.
7. In the Table of Contents, right-click the HPDDistricts layer and select Remove.
You will now work with a dataset containing the locations of all violent crimes (including
murder, rape, aggravated assault, and robbery) occurring in 2010, as reported by HPD.
8. On the right side of the ArcMap window, click the Catalog tab.
9. Drag the HPDCrime2010 feature class into the Map Display.
20
10. If the Geographic Coordinate Systems Warning window appears, click Close.
You will now clip the crime layer to the study area boundary to reduce the size of the dataset.
11. In ArcToolbox, double-click the Clip tool.
12. For Input Features, drag in the HPDCrime2010 layer from the Table of Contents.
13. For Clip Features, drag in the HISD layer from the Table of Contents.
14. For Output Feature Class, rename the feature class from HPDCrime2010_Clip
to HPDCrime2010_HISD and click OK.
15. In the Table of Contents, right-click the HISDCrime2010_HISD layer and select
Open Attribute Table.
Notice that you are provided with the date and hour of the crime, the type of offense, the premise
code, the number of offenses, and the approximate address. Since crimes are actually only
reported by the block address range, not the exact street address, this address represents the
midpoint of the block on which the crime was reported.
16. Close the attribute table.
17. In the Table of Contents, right-click the HPDCrime2010 layer and select Remove.
18. In the Table of Contents, uncheck the HPDCrime2010_HISD and HISD layers, so
that only the HPDDistricts_HISD layer is visible.
19. On the Tools toolbar, click the Full Extent button.
20. On the Standard toolbar, click the Save button.
Buffer
The final dataset you will work with contains the locations of all the elementary schools in
HISD.
1. On the right side of the ArcMap window, click the Catalog tab.
2. Drag the HISDElemSchools feature class into the Map Display.
3. In the Table of Contents, right-click the HISDElemSchools layer and select Open
Attribute Table.
Notice that you are provided with the elementary school name, address, and grade range.
4. Close the attribute table.
21
Now you will create a one-half mile buffer around each school, so that you will later be able to
count the number of violent crimes occurring in 2010 within each buffer.
5. In ArcToolbox, under the Analysis Tools toolbox, double-click the Proximity
toolset > Buffer tool.
6. For Input Features, drag in the HISDElemSchools layer from the Table of
Contents.
7. For Output Feature Class, rename the feature class from
HISDElemSchols_Buffer to HISDElemSchools_HalfMileBuffer.
8. For Linear unit, type 0.5 and use the unit drop-down box to select Miles.
9. Click OK.
10. In the Table of Contents, right-click the HISDElemSchools_HalfMileBuffer layer
and select Open Attribute Table.
Notice that all three fields contained in the original schools point layer (school name, address,
and grade range) have been preserved. In addition, a new field has been added stating the radius
of the buffer in feet.
11. Close the attribute table.
12. On the Standard toolbar, click the Save button.
At this point, you can see all of the violent crime locations along with the half-mile school
buffers, but much of the map is so densely covered with overlapping points that it becomes
difficult to tell exactly how many points there are and to see the underlying school buffers. In
addition, while you can see the spatial distribution of the points, you are not provided with any
sort of useful summary of the data. Performing a spatial join will allow you to discover exactly
how many violent crimes occurred within a half mile of each school in 2010.
The goal of performing a spatial join is to add a numeric field to the end of the school buffer
attribute table that tells you how many crime points are contained within each school buffer.
2. In the Table of Contents, right-click the HISDElemSchools_HalfMileBuffer layer
and select Joins and Relates > Join.
3. For What do you want to join to this layer?, select Join data from another layer
based on a spatial location.
22
4. For 1. Choose the layer to join to this layer, use the drop-down box to select the
HPDCrime2010_HISD layer.
For 2., notice that it now specifies you are joining points to polygons and updates the options
based on these respective geometry types. Notice also that the default selection ensures that each
polygon will automatically be given a count field showing how many points fall inside it. In
addition, you would like to generate a sum of the values contained in the number of offenses
field, since some crime points contain more than one offense.
5. For 2., check to summarize the Sum of each numeric attribute.
6. For 3., scroll to the end and rename the feature class from Join_Output to
HISDElemSchools_HalfMileBuffer_WithCrimeStats and click OK.
The new layer should appear at the top of your Table of Contents.
7. Right-click the HISDElemSchools_HalfMileBuffer_WithCrimeStats layer and select
Open Attribute Table.
8. Scroll to the right and notice the newly added Count_ field. This field tells you
how many crime points are contained within each school buffer. The new
Sum_Num_Off field tells you the sum of the number of offenses field contained in
the original crime points layer.
9. Close the attribute table.
Since the newly joined buffer layer contains all of the same information as the original buffer
layer, plus the new Count and Sum fields, you no longer need the original buffer layer. Since
your crime data has now been summarized, you no longer need the original crime points either.
10. In the Table of Contents, right-click the HISDElemSchools_HalfMileBuffer layer
and select Remove.
11. In the Table of Contents, right-click the HPDCrime2010_HISD layer and select
Remove.
12. Double-click the HISDElemSchools_HalfMileBuffer_WithCrimeStats layer to open
the Layer Properties window and edit the symbology.
13. Click the Symbology tab.
14. In the Show: box on the left, click Quantities and leave the default selection of
Graduated colors.
15. In the Fields box, for Value:, select the Sum_Num_Off field.
16. Under the Range column, click the range 3.000000 27.000000 and type 25 and
press Enter to move to the next range.
17. Type 50 and press Enter.
23
You can now easily tell which schools have the largest number of violent crimes occurring
within a half mile radius.
21. On the Standard toolbar, click the Save button.
At this point, only the elementary school point locations and the police district boundaries should
be visible.
2. In the Table of Contents, right-click the HISDElemSchools layer and select Open
Attribute Table.
3. Scroll to the right and browse through all of the attributes.
Remember that, at this point, the attribute table only contains the school name, address, and
grade range.
4. Close the attribute table.
5. In the Table of Contents, right-click the HISDElemSchools layer and select Joins
and Relates > Join.
6. For What do you want to join to this layer?, select Join data from another layer
based on a spatial location.
7. For 1. Choose the layer to join to this layer, use the drop-down box to select the
HPDDistricts_HISD layer.
For 2., notice that it now specifies you are joining polygons to points and updates the options
based on these respective geometry types.
24
8. For 2., check that each point will be given all the attributes of the polygon that it
falls inside.
9. For 3., scroll to the end and rename the feature class from Join_Output to
HISDElemSchools_WithHPDDistricts and click OK.
The new layer should appear at the top of your Table of Contents.
10. Right-click the HISDElemSchools_WithHPDDistricts layer and select Open
Attribute Table.
11. Scroll to the right and notice the newly added OBJECTID and District fields. The
District field tells you which police district each school falls within.
12. Scroll to the bottom and notice that the last five schools do not have a district
assigned to them. That is because those schools fall within HISD, but do not fall
within the City of Houston police jurisdiction.
13. Close the attribute table.
Notice that the toolboxes are expanded to the location of the particular tool you searched for
directly within the Catalog window.
Produce a map of the final layer generated after the Spatial Join, apply suitable
symbology and submit accordingly
25