Geography 481:  Intro to GIS
Project Four: Spatial Overlays


Building and operating a GIS would be much simpler if all the world's data were gathered and reported using the same spatial building blocks (e.g., counties, states or countries) and those boundaries were persistent through time. At the very least, it would be convenient if the spatial reporting units of different layers would simply nest within one another with no overlapping areas. Such is definitely not the case, however.  Quite often, we need to overlay layers that have completely different underlying geographies. This is particularly true when working with environmental data sets, where, for example, vegetation, groundwater, and land use polygons have completely different geographies with few or no common boundaries, and where administrative subdivisions such as cities or census tracts add still more complexity to the puzzle. How do we compare such dissimilar polygons? The answer lies in a group of related concepts known as spatial overlays.

In this activity, you will overlay a flood hazard map on top of an Orange County city boundary map in an attempt to identify areas within cities that have high and moderate flood hazard risks. Please note, though: this is a dummy data set with simplified boundaries designed to help you understand polygon overlays. It is not an actual map of flood hazards in Orange County (that map is much more frightening).

 


Setup


Geoprocessing

According to the ArcGIS documentation, Geoprocessing is "the processing of geographic information." What this definition lacks in elucidation, the geoprocessing functionality in ArcGIS makes up for in utility and selection. Geoprocessing encompasses a variety of tasks and manipulations related to spatial data and is, indeed, one of the most powerful components of a GIS. Tasks that fall under the geoprocessing umbrella include converting data from one format to another, creating buffers (hey, you were geoprocessing and didn't even know it), and performing spatial overlays. There are, in fact, hundreds of geoprocessing tools included in ArcGIS.

In ArcGIS, polygon overlays are performed using a set of procedures and functions referred to as "Geoprocessing Tools". Perhaps not surprisingly, we will be using the ArcToolbox window to access these tools. The ArcToolbox window allows you to display, manage, and use various tools and toolboxes in ArcGIS. To access the ArcToolbox:

The ArcToolbox window can be moved around to any convenient location on the screen. It is also dockable! Give it a try.


Clipping One Polygon Layer with Another

When you overlay a clip layer on a second polygon layer, any area of the second layer lying outside the area of the clip layer will be excluded. Notice on the map how the flood hazard layer extends eastward beyond the borders of Orange County. If you want to trim the flood hazard layer so that only the Orange County portion is included in your analysis, you use the ArcToolbox tools to "clip" off the unwanted portion.

Notice that there is “help” available on the right side of the dialog describing what the tool does. If you do not see any help on the right, click the “Show Help” button at the bottom right and it should appear. Take a minute and read the Clip help on the right to better understand how it works then do the following:

Turn the Ocfloodhaz.shp layer on and off and compare its spatial extent with the Floodhaz layer. Notice that it stops at the edge of Orange County. You have created new polygons made up of the Floodhaz polygon points within the county boundary and new points where the Floodhaz polygon intersected the County polygon. The original layers, Floodhaz and County, remain unchanged.

Now compare the attribute tables for Ocfloodhaz.shp, Floodhaz.shp, and County as follows:

The attributes from Floodhaz were passed to Ocfloodhaz.shp, but no attribute information from County was passed to the new layer. This is an important point to remember about clipping - no attribute information is passed from the clipping layer to the output layer.

Note: In class lectures we have been stressing the importance of thoughtfully selecting the appropriate technique for the problem at hand. Clipping is an example of an often mis-used tool in the GIS tool bag. In the example above, it is reasonable to clip the flood plain to the county boundary. It doesn't really matter, for the purposes of our analysis, where the floodplain extends outside of Orange County so it is reasonable to eliminate it from the floodplain layer. However, if one clipped the city layer using the floodplain layer, significant portions of some cities would be eliminated creating a rather puzzling, even misleading, view of the county. Another technique may be more appropriate in this case.


Union of Two Polygon layers

Often, you will want to combine attributes from two input layers into a third output layer. In the present project, for example, you want to overlay (and combine) the new Ocfloodhaz.shp layer and the Cities layer in a way that will permit you to identify both the city name and the flood risk in the same layer. To do that, you would use a type of polygon overlay called "union". Union preserves all of the areas (or polygon geometries) of both input layers and passes all attributes from both layers on to the output layer. Let's see exactly what that means:

Take a moment to read the Union help on the right to better understand how it works.

Note that the Cityfloodhaz output layer covers the combined area of the Cities and Ocfloodhaz layers. In fact, it might be a bit difficult to tell exactly what happened because the output layer looks an awful lot like the input layers. It includes areas of the cities that lie outside the flood zone, and areas of the flood zone that lie in unincorporated county land outside the city boundaries.

Now compare the tables. Open and arrange the tables as you did after the Clip overlay above. Note that the Cityname information has been brought forward from the Cities layer, and the Fld_haz information has been brought forward from the Ocfloodhaz layer. Both the polygons and the attributes have been "Unioned" together.

Finally, sort the Cityfloodhaz.shp table on the Cityname field. Note how Anaheim, for example, is now divided into five polygons (note only 4 records appear in the attribute table, but one actually represents 2 polygons in the Data Frame. Any ideas why this happened?), one with a High flood hazard, two with Moderate flood hazard, and two located outside the area of known flood hazard. If you sort on the Fld_haz field, you'll find a similar result. The single large polygon with a High flood hazard is now broken into numerous small polygons, each occupying part of a city or county area.


How Might This Be Useful?

At this point you might be asking yourself why anybody would want to divide up cities and flood zones in this way. Here is one possible application. Suppose emergency managers need to know which cities have the highest percentage of their total area in the flood zones so that they can attempt to allocate resources most effectively. Now that you have performed the "union" overlay operation on the FloodHaz and Cities layers, you have created individual polygons based on the geographic extent of the two initial layers. You merely need to calculate the areas for the new polygons to compute the percentages in the flood zones. Let's try it.


Using Python to Populate Area Field

Unfortunately, shapefiles aren’t the “smartest” data storage format available. In this case, shapefiles don’t come standard with an Area field, and even if you add one manually, you need to keep recalculating it manually every time there are changes to the sizes of your polygons. Below we will add an Area field and calculate it manually using the Python scripting language. Later in the semester we will use the geodatabase data storage format which is much “smarter” than shapefiles and automatically recalculates its Area field whenever there are changes to polygon sizes.

One of the extremely powerful aspects of ArcGIS is that it facilitates user customization of the application. One method of customization is to use the programming language, Python. We will learn more about customizing ArcGIS in Project 10. For now, do this:

The Area field should be populated with area values for each polygon, but what are the units? Hint: map units squared.

Try it again, but this time type !shape.area@squaremiles!

The Area field should be recalculated with area values in square miles. Can you calculate the percentage of Anaheim that is in the "high" Fld_haz category? Of course you can, but you will need the total area of Anaheim. Here is one way to calculate it:

The Count_CITYNAME field shows the number of polygon records that were summarized and the Sum_Area field lists the total area for each city.

Note: If for any reason (individual projects) you need to calculate polygon areas, this is one way to do it (there are others depending on your database).You could also have calculated the polygon geometry using the Calculate Geometry tools, as well.


On Your Own

Perform an analysis similar to the "Union" approach, only this time select the "Intersect" method of overlay.

Create a layout that contains:

Note: When creating your maps, remember the purpose of this layout is to illustrate the differences between the Union and Intersect operations. Thus, cartographically pleasing maps will allow the map reader to understand how the results of Union and Intersect affect the spatial data.


Last modified 09/21/2021