GEOG 370 – Spring 2008
Lab #4: Spatial Analysis
Due Dates: Tuesday Labs: Tuesday, March 18 by 11AM
Wednesday Labs: Wednesday March 19 by 2PM
Thursday Labs: Thursday March 20 by 11AM
1.Do the points and lines represent the data with the same level of abstraction? Discuss in terms of their representation of the two data layers(cities, roads) that we have added so far, and in terms of other types of data that they might represent.
2.What happens when you use the identify tool? Is the option to change the layer(s) being identified useful?
3.Why do you think the Field Definition requires that you differentiate between text and numeric data types? Why do you need to specify the field width?
4.What has changed in the table after joining?
5.How is the original attribute data from the States layer distinguished from the Weather data that you joined?
6.What would happen if you tried to join the attributes from the States layer to the Weather data (rather than joining the Weather data to the States data as you just did)?
7.Print screen of selected record
8.Print screen of new attribute table
Part 1
Points, Lines, and Polygons
Vector data are represented by points, lines, and polygons in a Cartesian plane. A point can be used to represent an area such as a city, or an earthquake epicenter. The line is used to portray linear features such as highways, and earthquake fault zones. If several lines are joined into a closed figure, a polygon is created. National boundaries, vegetation, or geologic formations are typically mapped as polygons.
The Join Command
The Join command is an important function in GIS. It links an ordered set of spatial objects, such as points, lines, and polygons, with an ordered set of aspatial objects, such as tabular data or flat files.
Visualizations
One of the great advantages of GIS over traditional cartography is the ease with which a single data set can be queried and visualized from different perspectives. Varying the ranges of values, or employing alternative category systems can produce vastly different map products.
Start ArcMap.
An exciting feature of ArcMap is the ability to change your map properties so that you can save links to the data layers in your ArcMap project as "full path names" or "relative path names." The choice of which to use is important, especially if you plan to distribute the work that you have been doing.
Go to File/Document Properties. Click Data Source Options. If you save the links to the data layers as full path names, when you open your ArcMap project it will look for your data in exactly the same location as it was the last time you saved the project (in other words., if all of your data layers were located in the d:\data folder, it would look in the d:\data folder for them when the file is re-opened. If you are now working from a different drive letter or on a different computer, you will not be able to view any of your data layers). When ArcMap cannot find a data layer in your project, it will appear in the Table of Contents with a red exclamation point next to its name.
If this happens, you can fix the problem by updating the link to the data layer source. To do this, open the layer properties, and under the "Source" tab click on the "Set Data Source…" button to reset the data layer source.
If you save the links to the data layers as relative path names, when you open your ArcMap project it will look for the data in the same relative location as it was before (in other words, if your ArcMap project was in the d:\lab3 folder, your data was saved in the d:\lab3\data folder, and you copy the entire lab3 folder to the e:\ drive of your computer, everything should work fine – your data is still in the same relative location to your ArcMap file).
If you change the location of your map files relative to your ArcMap file, you will end up with broken links to your data layers and will need to reset the layer source, as was described above.
If you do not have access to a permanent local folder to save your work, it is a good idea to copy all of the data for your labs into a folder and save it with your map file. When you do this, it is a good idea to change your map properties so that it saves the links to your data layers as relative path names. (You don’t need to worry about this because you have access to permanent folders).
Points
Naming your data frames and layers will help you stay organized when your work becomes more complex.
Add the cities.shp layer.
Name the data frame cities
Point data representing cities should now appear in your Data View.
You can change the symbol for the data by opening the layer properties and selecting the "Symbology" tab.
Click on the box containing the symbol to change its properties (size, color, etc.)
Change the symbol to a red circle of size 2. Click on Okay in the Symbol Selector, and click on Apply in the Layer Properties window to apply the changes. Note the changes in your Data View. Now change the symbol size to 16. Note the changes. Now change the symbol size, color, and angle to one of your choice.
Lines and Polygons
Now add the roads.shp layer from the same directory.
Use one of the data frame zooming tools pictured below to zoom in on an intersection between a group of cities and highways.
Use the Zoom to Full Extent (the "globe") icon to zoom back out.
Add the states.shp data layer from the same directory as before.
Exploring Attribute Tables
As is stated in the text, "the power of the GIS is in allowing the attribute and the geographic or map information to be linked together in a useful way." In this section we will learn about the structure of the tables containing the attributes for a spatial data set.
To start, we will explore the attributes associated with the states data layer. Select the "Identify" tool icon.
Click on a state in the Data View. Experiment with clicking on rivers and cities. In the Identify Results window, note that you can change the layer(s) that are being identified. Change the layer to "<All layers>." Click on an area where there are both cities and roads located near to each other.
Now right click on the states layer and select "Open Attribute Table." In the attribute table, click on the grey square to the left of one of the polygons. This will select it.
Hold down the Control key and click on several more polygons. In the attribute table options, explore the following menu options:
Also experiment with changing which records are being shown by pressing these buttons:
Joining Tabular Data to Spatial Data
We will now look at creating additional tables of aspatial data to link to existing spatial data sets. Now we will create a new table and join it to the States theme in our map. To get started, clean up your Data View. Holding down the shift key, select both the cities and roads layers, right click and select remove. Only the States theme should now remain.
We will need to use ArcCatalog to create our new data table, so open that module now. You can actually open it from ArcMap, rather than going through the Start menu as we have done before. Click on the ArcCatalog icon.
To set up a new table in ArcView, you need to have spent a bit of time thinking through the characteristics of your table. For instance, what type of data are you planning to add and how much space you need to reserve to store that data (for example., if the data is numeric, how many digits of precision do you need? Do you require decimal level precision?). All of this information will go into creating the structure for your table in ArcCatalog.
To start, in the Catalog Tree on the left hand side of the ArcCatalog window, locate your folder with the data for this lab. Select the folder so that you can see the data in the Contents window on the right hand side of ArcCatalog. In the Contents window, right click and create a new dBASE table.
A new dBASE table will now appear in your folder. Rename it weather.dbf.
We now need to add some fields to store our data. Right click on the table and select Properties. The Fields tab is where we edit the structure of our table – deleting fields, adding fields, and setting properties of fields.
To add a new field, type the name of the new field in an empty row in the Field Name column. Name your first field "States." Set its data type to "text." We should now edit the length of the field (the maximum number of characters that can be stored in any entry in the field) – for this table, set it to 20.
Note: It is very important that you define fields properly. In ArcMap there are seven field types. Four of them are numeric types of different precision (short integer, long integer, float, and double). The remaining types are Text, Date, and BLOB (Binary Large OBject – a binary data type that stores large image, text, or geometry data as attributes). We will use only Text type data in this lab. Text data is sometimes referred to as String data.
We will also add a Weather field of type Text and length 10.
Now that you have defined the structure of your table, we can add some data to it. Where editing the structure of a table is done in ArcCatalog, editing the contents of a table is done in ArcMap. Add your table to your ArcMap project.
Note that when you add the table to ArcMap you can only see it in the Table of Contents when you have the Source tab selected in the Table of Contents. This is because the table by itself is not spatial and is therefore not shown in the Data View.
To edit the table, right click on the table icon and select "Open." Now turn on the Editor toolbar by clicking on Tools in the main menu bar and selecting "Editor Toolbar." Click on the Editor button on the toolbar and "Start Editing."
Click in the first State record and type in the name of a state. Then type in a general weather description in the Weather field for each record (remember that we set the length of the field to 10 characters!). Create weather records for ten more states.
Now pull down the Editor menu on the toolbar, and select Stop Editing. When you are prompted to save your edits, select Yes. Alternatively you can save edits while you are working by pulling down the Editor menu and selecting Save Edits. It is a good idea to do this periodically, just in case the computer crashes or the software freezes.
Now we will join our new weather.dbf table to the table for States.shp. The names of the states will be used to relate the two fields to each other – because of this, it is very important that you have spelled the names of the states correctly and capitalized appropriately! It is very important to understand the concept of source and destination tables. States for which you have not supplied a value in the weather field will end up with a blank entry in the record. The data then is moving from the source table: Weather.dbf, to the destination table: Attributes of States.shp. Be certain that you have stopped editing your weather table.
Right click on the States layer, select "Joins and relates." Select Joins. In the window that opens, select "State_Name" as the field on which the join will be based (this is the field in your "Destination" attribute table, the attributes of the States layer). Choose Weather as the table to join to the States layer. Select the "States" field as the field on which the join will be based in the Weather table.
When you have everything set up, click OK.
Open the attribute table for the States layer (right click and select "Open Attribute Table.") Examine the table.
Conclusion
In this part we have explored the three basic vector data types: points, lines, and polygons. In addition we have explored the structure of the relational database. We have seen that spatial data in the vector format consists of spatial data objects linked to flat files or tables consisting of aspatial data objects. We have seen that new data tables can be written and related to existing data tables.
Part 2
Assignment Overview
In this assignment, you will use ArcView's raster analysis capabilities to perform a suitability analysis to determine optimal locations for a new office building in the town of Chapel Hill. First, you will create a series of derived, or scored maps from original map layers of roads, hydrography, and zoning. Then you will weight the scores to develop a final suitability map that highlights optimal locations for the new office building.
The Scenario:Your client is a developer who wishes to build a large office building in the town. She has the following criteria for selecting a site:
- Locations near major roads are desirable for transportation purposes.
- Locations near streams are undesirable; by avoiding flood risks she can keep insurance costs down.
- The building must be located within Chapel Hill's Office/Institutional (O/I) or Mixed-Use and Office/Institutional (MU-OI) zoning districts.
You will be graded on the following:
- Four Questions: Questions 1-4 (1 point each)
- Three maps (2 points each)
Make sure your maps contain the following elements: A useful title that is descriptive of the map, a useful legend that communicates to the map reader the symbolization you have used, your name, and the correct spatial analysis.
(Q1)What does the reclassification step in Step 1 accomplish?
(Q2)At the end of Step 3, what does the map tell you in terms of the developer’s office building project? What do the highest scores represent? What do the lowest scores represent?
(Q3)What does Step 4 accomplish towards producing the final suitability data layer?
(Q4)Prepare a brief executive summary (~2 paragraphs) to the developer, summarizing your results. Include a short description of the analysis you performed and indicate the locations you think would be the best choices for her office project.
Maps: JPEG of roadscore (end of Step 1), JPEG of hydroscore (end of Step 2), JPEG of final suitability layer (end of Step 4). These should be completed maps (i.e. ready for display) and saved in your student folders.
Data for the Assignment
All data layers are in NC State Plane coordinate system (NAD1983 datum, GRS1980 spheroid), with coordinates expressed in meters.
J:\isis\html\courses\2008spring\geog\370\006\data\lab4\ch_zoning
Chapel Hill zoning - a raster data layer (rasterized from the original vector version) containing the major zoning district codes for the town. Spatial resolution is 30 meters.
J:\isis\html\courses\2008spring\geog\370\006\data\lab4\ch_roads
Vector data layer containing roads and streets for the town of Chapel Hill.
J:\isis\html\courses\2008spring\geog\370\006\data\lab4\ch_hydro
Vector coverage containing arcs representing creeks and streams within the town of Chapel Hill.
J:\isis\html\courses\2008spring\geog\370\006\data\lab4\ch_dem
Raster data layer containing digital elevation model data for the town of Chapel Hill. Elevation values are in meters. Spatial resolution is 30 meters.
J:\isis\html\courses\2008spring\geog\370\006\data\lab4\ch_boundary
Chapel Hill town boundary. This may be useful in designing maps to show the analysis results.
Notes
- Before you begin work on this project, you will need to enable (check) the Spatial Analyst extension under Tools | Extensions so ArcMap’s raster analysis functions will be available to you.Then go to View, Toolbars, Spatial analyst.
- Make sure to create a new folder called lab4 in your student workspace. Keep in mind that you should only have one project for this lab. If you make more than one project, you will have problems.
- MAP YOUR DRIVE!!! And then for working directories, use your mapped drive, NOT the j drive.
You also need to set the working directory in your project. Under Spatial Analyst (drop down) |Options, type in your working directory by typing in the path name for your student workspace:
(General Tab)
J:\isis\html\courses\2008spring\geog\370\006\students\youronyen\lab4
Not doing so will cause you to have major problems later in the assignment!
Step 1. Create data layer with roads suitability scores.
In this first step you will create a new data layer containing suitability scores based on proximity to roads.