Transcript
Intro to GIS Exercise #3 – TOC‐Data frame visual hierarchy / Select by Attribute / Select by Location / Geoprocessing IUP Dept. of Geography and Regional Planning – Dr. Richard Hoch Due on Monday February 29. Please prepare answers to the questions at the end of this document in a separate word document and place in the P drive folder (see below). Name the documents, “[YOUR LAST NAME]_Ex2” If you are in the RGPL section go to: P:\courses\spring2016\RGPL\RGPL316\001\students If you are in the undergraduate GEOG section, go to: P:\courses\spring2016\GEOG\GEOG316\001\students If you are in the graduate GEOG section, go to: P:\courses\spring2016\GEOG\GEOG516\001\students In this exercise we will: Change the Symbology for datasets Understand the relationship between Table of Contents order and the display of the visual hierarchy within the data frame Manually select data from an attribute table based on a single characteristic Select data from an attribute table based on a single characteristic using the Select by Attribute Command Select data from an attribute table based on the geography of another dataset using the Select by Location Command Perform fundamental geoprocessing operations o Dissolve o Clip o Intersect
Today we are going to focus on determining our Project Area. The watershed we will be preparing our plan for is the Two Lick Creek watershed. Following completion of Exercise 1, you should already have the land‐cover dataset added to your project and displayed in your data frame. Zoom to the visual extent of the Indiana County land‐cover dataset by right‐clicking on the title (text) of the dataset in the table of contents (TOC) and select ‘Zoom to layer’. This command will zoom to any dataset you choose to apply this command to. In other words, the zoom to layer command displays all of the data in a particular dataset in the data frame. Now turn‐off the display of the ‘Indiana County_2006’ land‐cover dataset (click the check mark in the TOC) and add more data into the project. Again, there are two easy ways to do this: 1) you can simply drag‐and‐drop from ArcCatalog to your TOC, or 2) use the ‘add data’ button on the tool bar (The ‘plus’ sign on top of the brownish square). Add the following datasets: ‘County’, ‘Municipalities’, ‘streams’, and ‘watersheds’. Each of these datasets will display using some default color scheme as well as ‘filled‐in’ area colors for the polygon datasets. Let’s change the symbology so that they are more intuitive and easier for us to understand visually. Again, like the land‐cover dataset, you can either: 1) right‐click on the title (text) in the TOC and choose ‘Properties’ and then choose the symbology tab, then change the fill color as well as the outline color, or 2) you can go directly to the ‘Symbol Selector’ window by double‐ clicking on the symbol of the dataset that is displayed in the TOC. For this exercise, double‐click on the symbol for the ‘County’ dataset. This should make the Symbol Selector window to appear. Explore the options in this window. After you’ve poked around a bit, change the symbol for ‘County’ to a solid black line with an outline width of 2.00 with no fill color leaving it hollow. NOTE: You must choose the ‘No Color’ option to hollow out the dataset. Choosing the ‘white’ option may make it appear as if it’s hollow, but this is because the background of your data frame is, by default, white. NOTE: you can change the background color of your data frame (and what will eventually become your map) by going to the View menu → Data Frame Properties → Frame tab → Background option. Depending on how you added the datasets above into the TOC, the order they are displayed may different from your classmates. Why is this the case? And why does this matter? ANSWER: This matters because how the data layers are displayed ‘on top of each other’ in the dataframe is dependent on the order of the datasets listed in the TOC ‐meaning the dataset that is at the top of the TOC list will be displayed ‘on top’ of the next dataset in the TOC that is listed after it – and so on, and so on, and so on. Get it? If not, read more below. After I turned off the land‐cover dataset and changed the symbology of the datasets we just added, my data frame looks like this:
But I want the order of the display of the datasets to be different. So I will simply drag and drop the layers in the TOC to represent the ‘order’ (from bottom to top, or top to bottom) that I want the data to be displayed like. Make the data display in the data frame in this order, from top to bottom: ‘County’ – ‘Munic’ – ‘Watersheds’ – ‘Streams’. It should look like below: Do you see the difference? This order creates what cartographically is called the ‘visual hierarchy’.
Now we will choose the:
watershed boundary streams within the watershed, and municipalities that intersect the watershed
and, once again (!), there are many ways to do this… Since we know what watershed we will be preparing maps for (Two Lick Creek), but we don’t know where the geographic location is of the Two Lick Creek watershed (TLC) is, we will start by simply looking at the attribute table of the ‘Watersheds’ dataset. To do this, right‐click on the ‘Watersheds’ title (text) in the TOC. Then choose ‘Open Attribute Table’. A window displaying a database table should appear. This table contains all of the attributes associated with the ‘Watersheds’ data. [REMEMBER: Columns (top to bottom) represent one particular attribute for the many entries in the database. Rows (side to side) represent one particular entry (feature) and all of the attributes for that entry within the database].
Explore all of the attributes in the table. These attributes are the fields listed in the header row of each column. For example, the first column displays the feature identification number for each entry in the database. This is represented in the table as a field entry titled ‘FID’ in the header row of the first column. Next is ‘Shape’ which tells you what kind of vector data model each entry is represented with. There are many other fields in the database – many of them you may not know what they mean… what would be your first step in trying to figure out what each of these fields represent? (I hope the first thing that came to your mind was, “Oh! Metadata! Yeah! Metadata!)
QUESTION: What does HUC mean?
Now, let’s go to the ‘DESCR’ column. DESCR means ‘description’ and this column, as you can see, lists all of the individual, discrete watersheds by their name. Scroll down and find ‘TWO LICK CREEK WATERSHED’. HINT: If you right click on the field name in the header row atop each column, a series of demands is available to you, including two ‘sort’ commands – check it out.
Once you have found TWO LICK CREEK WATERSHED, you want to ‘select’ it as the feature in the table that you want to isolate. You can’t do this by clicking the individual cell within the table, you must go to the left side of the table and click on the grey square with the small triangle in the same row as the cell – this should highlight all of the cells for that feature in the table with a turquoise color. If you don’t see the entire row colored in with turquoise, try again. If you still don’t see this, please stop and ask for assistance from your classmate or your lab instructor.
Now go to the data frame – the feature that you highlighted in the database table should now be highlighted with the same turquoise color within your data frame. Like this below:
Wow… that’s like magic! Seriously, this simple exercise should demonstrate to you the linkage between the tabular data (that means data in a table) and the shape data within a shapefile dataset.
Now that we can see the watershed, we notice that it is not the complete drainage of TLC – this feature only represents the drainage of the mainstem of TLC, not all of the contributing steams (tributaries) that make up the drainage of the watershed. We must dig deeper. Go back and open the ‘Watersheds’ attribute table. In the ‘STRMSHED’ column, we can see that there are many ‘TWO LICK CREEK’ entries. ‘STRMSHED’ is an attribute that describes the PADEP Designated Stormwater Management Watershed Name. How do I know this? (ahhh, yes – metadata).
So we want to choose all of the TLC entries in the ‘STRMSHED’ column. How? Again, several ways. You can sort the column alphabetically and manually select the several entries. Let’s try this first. Once sorted, click the row selector on the left side of the table that represents the first TLC entry. Hold down the “shift” key. Then go to the last row with the TLC entry in ‘STRMSHED’. Now all entries should be selected and both the table and data frame should look like below:
Great! We have now delineated our project area! We want to make this subset of the ‘Watersheds’ dataset its own dataset. Therefore, we will create a new shapefile from this selection. To do this, right‐click on the title (text) of ‘Watersheds’, go to ‘Data’, then ‘Export Data’. The Export Data window should appear with many options to choose from. We want to ‘Export: Selected Features’ There are two other options here, investigate by using the pull‐down menu. Next it asks which coordinate system that you want to assign to this new shapefile. This is the GIS analyst’s choice. Do you want the shapefile to be in the same coordinate system as the source data? Or of the data frame, which we assigned in the last exercise? My preference (and what I am asking you to do) is to choose ‘the layer’s source data’. Why? Because we have already assigned the coordinate system of choice in the Data Frame Properties, therefore, the new shapefile will be projected using the ArcGIS on‐the‐fly projection utility. [NOTE: If you are to provide the data used in your project in the projection of the project, as a stipulation of the scope of work, then this option provides a way for you to easily re‐project data to the project coordinate system.]
The next option is to what Output feature class you desire. We want to export the subset of the data we selected as a shapefile. The default data location path is probably not your home, or root, directory, and the default data export type is a geodatabase (.gdb). We need to change these. How? Use the folder button to the right of the data path window. From the ‘Saving Data’ window, choose your project root directory in the ‘Look in:’ pull‐down; name the dataset you will be creating (‘TLC_watershed’, for example); and change the default setting in ‘Save as type:’ from ‘File and Personal Geodatabase feature class’ to ‘Shapefile’. Then hit ‘Save’. Then ‘OK’. It then asks if you want toad the exported data to the map as a layer. If you click ‘Yes’, then the file will display in both the TOC and the data frame. Remember, once you do this, the .mxd file will save the path to access this data at the current settings. We dumped the new shapefile (TLC_watershed) in the ‘shapefiles’ folder. If you want to move this file to a different folder in your data catalog, then choose ‘No’, then using ArcCatalog, move the file to a folder of your choosing (This reckons back to Exercise 1 – get it?)
With the new dataset in your TOC and displayed in your data frame, it should look like this:
Notice that the new dataset (TLC_watershed) is at the top of the TOC, thus it is displayed at the top of the visual hierarchy (on top of all other data in the data frame view).
Ok, let’s stop and re‐evaluate. We selected the features we wanted in the ‘Watersheds’ dataset manually. This is easily done when there are relatively few entries to select – but would this be the preferred method if there were hundreds or thousands of entries to select in a dataset? No. So how would we select the same entries in some automated way? ANSWER: Select by Attribute
Let’s do it. In the TOC, turn off the ‘TLC_watershed’ dataset that we just made. The selected features from the ‘Watersheds’ dataset are probably still highlighted in turquoise. If so, let’s clear the selection by clicking the ‘Clear Selected Features’ button on the toolbar. It looks like this:
Now that all of the selections have been cleared, we are going to select them again using the Select by Attribute command. Go to the ‘Selection’ menu → Select by Attributes. Now we will use the window to construct a simple SQL (standard query language) command using Boolean operators.
In ‘Layer:’, select ‘Watersheds’. In ‘Method:’ we, again, will choose ‘Create a new selection’. Then in the next window pane, all of the fields of the table will be displayed. Navigate to the desired field (Which field will we be querying (questioning)? It will be the same one we used to select the features manually: ‘STREMSHED’. Click and highlight ‘STRMSHED’. Now we must construct our query. We want to select a particular value in the ‘STREMSHED’ column, that being ‘TWO LICK CREEK’. (Are you following this? If not, ask questions). How do we select ‘TWO LICK CREEK’? We must choose the ‘Get Unique Values’ button for all of the individual values to be displayed. Navigate and select ‘TWO LICK CREEK’. It should look like the window to the left:
Now double‐click the selection (TWO LICK CREEK) in the pane. It will show in the window below that says, ‘SELECT *FROM Watersheds WHERE:’ ‘TWO LICK CREEK’. Now your job is to properly construct the query.
Use the ‘verify’ button to tell you whether you have constructed a properly stated SQL statement. If you have properly queried the data using the Select by Attributes command, the selection of the ‘Watersheds’ data should be highlighted in your data frame and should be identical as the watersheds you chose using the manual method. You can create a new dataset from this subset, but if it is the same as the previous, there is no need. This was an exercise to demonstrate the two different methods to select features in a dataset. Let’s move on.
Clear the selections using the ‘Clear Selected Features’ button. DISSOLVE Your task is to make one polygon feature of the subset TLC_watershed dataset. How? Use the Dissolve tool in the Geoprocessing menu. The goal of this task it to create a new shapefile that is one polygon – not the many polygons features that are in the ‘TLC_watershed’ dataset. Name this new dataset, ‘TLCW_dissolve’.
QUESTION: How many features are there in the ‘TLC_watershed’ dataset?
I expect you to do this through trial and error. It may be frustrating at first, but this is the best way to learn how these operations work. USE THE HELP MENU ON THE RIGHT SIDE OF THE ‘DISSOLVE’ WINDOW TO PROVIDE YOU INSTRCUTION ON WHAT THE VARIOUS OPTIONS ARE FOR THIS OPERATION. [You are on your own here – work together with your classmates to figure this out. Of course, I will gladly assist you too, but the task if for you to struggle through this on your own before asking for assistance.
Once you have created the file successfully, it should look like this: CLIP Use the Geoprocessing Menu to Clip the streams to the new ‘TLCW_dissolve’. Name the new stream file, ‘TLCW_streams_CLIP’ and place it somewhere within your home/root directory.
If successful, it will look like this:
Now, in your TOC turn off all datasets other than the ‘TLCW_streams_CLIP’, ‘TLCW_dissolv’e, ‘County’, and ‘Munic’. Also, if you haven’t done so already, change the symbology of the TLCW_streams_CLIP data. I suggest that you choose a blue that you will be using for water – the same that you used in ‘Indiana_County_2006’ land‐cover dataset, with a weight of 1. Also change the symbology for ‘TLCW_dissolve. I suggest that you choose no color for the fill, anduse a red line with a weight of 2. Your data frame should look like this:
INTERSECT
Your last task is to select the municipalities that intersect our project area (TLCW). Use the ‘Select by Location’ command in the ‘Selection’ menu. In the Select by Location window, our Selection method: will be the default – ‘select features from’ We will be selecting features from ‘Muni’. NOTE: be sure to un‐select other features in the ‘Target layer(s):’ pane if there ‘checked off’ but not of your doing. Sometime the software will choose the last dataset you made selections from for you by default (I hate that…). Our
source layer will be ‘TLCW_dissolve’.
Now it is up to you to choose the proper ‘Spatial Selction method:’. REMEMBER: we want to select the municipalities that intersect the watershed. This is NOT the same as CLIP. We want to select them in their entirety. Your data frame should look like this:
Now create a new shapefile called, ‘TLCW_munis_INTERSECT’ by right clicking on ‘Munis’, going to data and following the same procedure as we did above for the ‘TLC_watershed’ dataset.
Your final data frame should look like below:
Fantastic! You have just completed basic geoprocessing of spatial data in ArcGIS 10!
Now, answer the following questions and submit them in a word document placed on your S: drive folder. (Please re‐state the question in your documents prior to listing your anweres.)
What does HUC mean?
How many features are there in the ‘TLC_watershed’ dataset?
How many municipalities intersect the TLC watershed?
Please list each of the municipalities that intersect the Project Area.
Place a screenshot of the final view in the data frame (it should look like the last graphic above) in your word document.
To place a screenshot of the ArcGIS GUI in a word document, simply press the ‘Print Screen’ button at the top right of your keyboard. Then, in the word document, paste. You can crop the image by double clicking and choosing the crop option in the File Size option. This should automatically appear after you double click on the image in the word document.
Congratulations!