Data Structures & Database Queries in GIS Objective In this lab we will show you how to use ArcGIS for analysis of digital elevation models (DEM s), in relationship to Rocky Mountain bighorn sheep (Ovis canadensis) sightings from the Mt. Nebo range near Nephi, Utah. The assignment will be to determine if two different populations of sheep which were imported into the Nebo range utilize different habitat types. Skills you should obtain from this lab include: How to map (and save) text based coordinates in ArcMap. Ability to query raster and vector data sets based on various attributes in order to display and/or extract data applicable to your study. Derivation of new data layers from existing elevation data (DEMs).
Getting Started The data you need to do the first part of this lab can be download as a zip file from http://hbll.link/pws357lab The link will download a compressed (.zip) file to the Downloads folder. Extract all of the contents (right click & select Extract All ). Import bighorn sheep sightings Add sheep sightings into ArcMap by clicking the Add Data button You will need to Connect to the folder where you put your data. Click the Connect to Folder icon at the top of the dialog box, then browse to where you extracted the data on the local drive and click OK. Select the Excel file named Nebo_sheep_Spring2007.xls clicking Add at this point (or double clicking to add) will show you a list of individual sheets within the Excel file. In this case, there is only one - Nebo_sheep$ - select it and press OK. The Excel sheet will show up in the Table of Contents of your ArcMap map document (left side). In order to plot data points to a map, the X and Y coordinates must be in separate columns, AND you must be able to tell ArcMap what those coordinates are (e.g. latitude & longitude, or UTM eastings & northings, etc.) as well as the datum the coordinates are based on. Right click on Nebo_sheep$ and select Open. With columns of Easting and Northing, you know we are dealing with UTM or State Plane coordinates. In this case they are UTM. They are on Mt. Nebo, so we know that we are in Zone 12 North.
You couldn t know just from looking at them (missing metadata!), but the datum is NAD83. Once you know this, you can use the coordinates to place these points in the proper geographic position so that you can use them with other data (e.g. the elevation data). Mapping the coordinates to points is done by right clicking on your file in the Table of Contents (Nebo_sheep$) and selecting Display XY Data. On the resulting tool interface, tell ArcMap which fields contain your X and Y data (X=Easting, Y=Northing). Before you click OK, you need to also tell ArcMap the coordinate system of these values (currently set to Unknown Coordinate System). Set the coordinate system by clicking the Edit button. UTM is a projected coordinate system, so expand the Projected Coordinate System folder, find UTM, then NAD 1983, then Zone 12 north. The actual projection file is called NAD 1983 UTM Zone 12N. ArcMap works internally on a spherical XYZ coordinate system that can be mapped to various coordinate systems. This allows you to add data with UTM coordinates to data with Lat/ Lon coordinates and have them match up on the map. If you don t tell ArcMap what coordinate system your data represents (or tell it the wrong one), this auto-aligning of data will not work. Click OK, then OK again. ArcMap will warn you that your data does not have an Object-ID field. Read the instructions on how to fix this issue because it is the next step you will need to do it in order to complete this lab. When you are ready, click OK one more time. You should see data points in the map area now. If not, try again (double check X & Y). This new point layer is only temporary and will disappear when you close ArcMap. Until it is made permanent, it is only good for looking at & cannot be used in spatial analysis. BEFORE doing anything else, you need to create a geospatial database (geodatabase) to hold your data. Right click on your data folder in the Catalog tab
Select New -> File Geodatabase and name it appropriately (e.g. 212DBLab) (here is an article outlining the advantages of File Geodatabases over Personal Geodatabases and collections of Shapefiles). Export the displayed XY data points set into your geodatabase by right clicking on the file in the Table of Contents under Layers named Nebo_sheep$ Events and choosing Data/ Export Data Click the Folder icon on the bottom right next to the file path Use the Save as type: drop-down to select File & Personal Geodatabase Feature Class and save it in the geodatabase you just created in your data folder. Leave the coordinate system the same as the source data. Once saved, ArcMap will ask if you want to add the new layer to the map. Say yes. Once it appears, go ahead and remove the temporary Events layer and the Nebo_sheep$ table from your map (right click and select Remove on each of them). Before moving on, you should save your map. ArcMap saves what is called a Map Document that is really just a text file that points to all the different pieces of your map. By default it hard codes the entire path to where your files are, so if you were to move your project folder to another computer it may not work. To avoid this, go to File -> Map Document Properties (right at the bottom) and set the Default Geodatabase to the one you just made in the data folder, then click the box next to Store relative pathnames to data sources. SAVE! - be sure to save the map document in the same folder as your geodatabase. There are many things that could be used to define habitat types. In this case we will be looking at the dominant vegetation and the characteristics of the terrain in the areas they were observed. Dominant Vegetation Data You ll notice there are two Dominant Vegetation layers in the data folder for this lab. One is a Geodatabase, one is a Shapefile. Add them both to your map. Use the Info tool to determine which one of these you want to use in your analysis. Add the Shapefile version & click on a few polygons to see what information you could use.
Now add the Geodatabase version & do the same thing. Remove both of them from your map. Right click on the DominantVegetation layer inside the geodatabase and select Copy. Right click on your geodatabase and Paste it in. Add the layer from your geodatabase and classify it according to dominant vegetation. Working with Elevation Data Add the raster file DEM_Nebo by clicking on the Add data button on the standard tool bar. You could also add this layer by dragging it from the ArcCatalog sidebar into the map area. If it asks you to build pyramid layers, say yes. If you want to know what pyramid layers are (http://desktop.arcgis.com/en/desktop/latest/ manage-data/raster-and-images/raster-pyramids.htm) A digital elevation model (DEM) is a digital representation of ground surface topography or terrain. In short, the DEM we are using is a raster, which is made up of a grid of squares each containing a unique elevation value. Each grid represents a 10m x 10m square on the surface of the Earth. Because the DEM has already had its coordinate system defined, it will appear in the same location as your sheep points (assuming you appropriately set those points as UTM NAD83 Z12N). If you ever have data that should show up in the same location but doesn t, then you have a coordinate system problem. Habitat is more than just the elevation the sheep are using. DEMs are generally the deliverable the end user must derive other layers from. We can calculate slope & aspect from a DEM by comparing values of neighboring grid cells. This requires the use of the Spatial Analyst extension. Turn on the extension by going to Customize -> Extensions and make sure the is a check mark next to Spatial Analyst Calculate slope by clicking on the Search tab at the right (if you ve pinned open the Catalog it will be at the bottom), or click the Search icon in the main toolbar and typing slope in the search box. There is a Slope tool included in the 3D Analyst extension as well, so make sure to select the Slope (Spatial Analyst) tool in the results and click it to open the tool s dialog box.
Select the dem_nebo as your input raster If you set your default geodatabase in the document properties it will automatically save the new slope raster in it. You can rename it from the default to make it clearer to you what it is (best practice). Leave the measurements as DEGREE and the Z factor at 1.* The slope map will be added automatically to your map after you press OK (be patient). *the Z factor should only be changed if your X & Y units are different than your Z units. SAVE! Calculate aspect by searching for the aspect tool in the search box. Again, be sure to select the Spatial Analyst version of the tool. Select the dem_nebo as your input raster The aspect raster will be added automatically to your map after you press OK (be patient). SAVE! Calculate a hillshade image Search for the hillshade tool in the search box. Select the Spatial Analyst version of the tool. Select the dem_nebo as your input raster The hillshade image is a visualization tool, creating a 3D representation of the terrain values in the DEM. You can change the direction from which the light will shine and the angle from which you will view this terrain if you desire. I wouldn t recommend large changes from the default values to avoid pseudoscopic illusion. The hillshade image will be added automatically to your map after you press OK (be patient). SAVE! Data Exploration and Analysis Get to know your data: Select the Identify tool ( ) and click around the map. Clicking on one of the points will allow you to see the
attributes associated with that point. Clicking anywhere else will show you the attributes associated with the grid cell in the topmost raster. You can turn off each layer in the Table of Contents to get values from lower layers, OR you can simply select the layer whose values you want to see in the dropdown on the Identify dialog box. To see all attributes of the point features at once, open the attribute table by right clicking on the layer in the Table of Contents. ArcMap created two fields (columns) to keep track of each point feature: OBJECTID* & Shape*. The other fields (columns) are the same as in the input Excel file: ID, Source, Easting, & Northing. The Source field allows us to differentiate between two populations of bighorn sheep which are labeled as S1 and S2. These two populations were introduced from different source locations and at different times to the Nebo range. To make them look different on the map, double click on the layer in the Table of Contents, then select the Symbology tab. We want to symbolize the data points based on their source category, S1 or S2. Select Unique Values under the Categories section on the left. Select Source as the Value Field on the right. Click Add All Values at the bottom. You can double click on the actual point next to each category and make the symbol something you like better / can distinguish. Click OK and you should see your two populations represented on the map by different symbols. Analysis GIS analysis is only as good as: Your input data
Your understanding of your input data At this point you have prepared your data and become familiar with what the values in each layer mean and are ready to do some analysis and answer some questions about these two sheep populations. Spatial Join Relational database principles are at the heart of any GIS. What makes it a Geographic information system is that in addition to joining records in your table based on attributes (which can be done in a GIS), you can also join based on location. Search for the Spatial Join tool and join the DominantVegetation information to the Sheep sightings. Because there are multiple sheep sightings in each vegetation polygon, be sure to specify that it is a One to Many join. Now you want to associate the data you ve calculated from the elevation model with the location of each sheep. The tool you will be using is called Extract Multi Values to Points. Use the Search tab again and type extract values and find the Extract Multi Values to Points (Spatial Analyst) tool. Although it is technically a spatial join, the tool name is unique to raster datasets. As evidenced by the (Spatial Analyst) indicator, this tool functions with rasters. It s purpose is to look at the raster value at coordinate of each of your sheep points and append that value to the attribute table of your sheep points.
If you were using Shapefiles for your points OR if you only had one raster you would not use the Multi version of this tool Select your Sheep points layer as the Input point features Using the dropdown OR dragging from the Table of Contents, add your slope, aspect, & DEM to the Input Rasters box. The Hillshade just looks nice - the values don t have any meaning for analysis. Click OK Statistical Analysis Open the attribute table for your sheep points layer (right click on the layer in the Table of Contents). There should now be columns with the slope, aspect, and elevation for each sheep point. Basic statistics can be computed by for a data set by right clicking on the column of interest and selecting Statistics. You will see a histogram (frequency distribution) of the sheep points for the attribute in that column and basic descriptive statistics. Using the dropdown you can see these statistics for any column.
This is a quick way visualize your data. We can quickly see that the 79 sheep we sighted were on slopes ranging from 18.7 to 50.5 (histogram and/or Min/Max values), that the average slope value was 37 with a standard deviation of 5.8. The histogram shows relatively normal distribution of the slope values. Calculating statistics for different groups based on an attribute: Source The example above is for the all the sheep in the points layer. However, the ultimate question is whether there is any difference between the two sheep populations based on their source. In order to answer this question you could separate the two populations into two layers, but that is needlessly complex. One of the most common ways to interact with different subgroups of your data is to use the Select by Attributes database functionality. This is done use Structured Query Language (SQL). Fortunately you don t need to be an expert, as the select by attribute dialog has a query builder. Open it from the attribute table menu, or from the main ArcMap Selection menu. The SQL query can be built by double-clicking on Source, then the = sign, then click the Get Unique Values button to see your options. Double click S1 to complete the query, then Apply. All the records with S1 in the Source field should now be selected (highlighted in blue) in your table. You can now click on the column header & select Statistics & the results will be calculated only for the selected fields. Select by Attributes could also be used to select all sighting meeting some other criteria (besides source). For example, all sightings at elevations greater than some threshold, on Southern Aspects, etc.
Summarize For this lab, rather than select by attribute then calculate statistics for each variable of interest separately, what you really want to use the Summarize feature in the table. This tool will create a table summarizing the attribute data based on some variable of your choosing. ** By default, ArcGIS Tools act only on the selected records. Because you want to summarize ALL records, make sure you don t have any records selected. Click the Clear Selection button on the table or ArcMap toolbar. You shouldn t have anything in the table or on the map highlighted in the blue color before proceeding. ** Right click on the Source column & select Summarize.
In the Summarize dialog box leave Source as the field to summarize on, then select Average, Standard Deviation, & Variance for Elevation, Slope, & Aspect. Make sure the resulting table will be saved into your geodatabase & click OK. The table will be added to your Table of Contents. Open it by right-clicking & selecting Open Use the data to fill out the following tables (use the Word document to fill in & submit your answers). S1 N: S1 Elevation Slope Aspect Average Standard Deviation Variance S2 N: S2 Elevation Slope Aspect Average Standard Deviation Variance 1. Describe in general terms any differences you see in the two populations based on these summary statistics.