Geography 387 Lab Home | Geography 387 Home | Geography Home
Lab 5: Data Model TransformationsOutline
** Before you begin this lab, review the "General" section of the ArcGIS Tips and Tricks webpage. Don't skip this step...it will ultimately save you time! 1.0 IntroductionAlthough modern GIS systems can manage both raster and vector data, it is still often necessary to covert from one data model to the other. The primary reasons are that 1) the vector format stores discrete features more efficiently than does the raster format and 2) it is often necessary to have all data in one format for analytical operations. The ArcGIS software provides simple-to-use tools for converting between data models. We will experiment with these tools in this lab. Along the way, we will also learn how to store symbology in a layer file, how to measure map distances with an ArcMap tool, and how to compute summary statistics of a numeric attribute. 2.0 RasterizationRasterization is the process of converting vector feature data to a raster format. There are three possible types of conversions:
The cell size you choose when converting from vector to raster should be based on several factors, mainly the resolution of the input data, the output raster resolution needed to perform analysis, the need to maintain an efficient processing speed, and storage limitations. 2.1 The ScenarioThe invasive weed, Yellow Starthistle, has aggressively spread throughout many regions of California. You have been hired by Pepperwood Preserve (just Northeast of Santa Rosa) to develop a GIS model that predicts habitats that are susceptible to the establishment of this species. To complete this task, there are several basic data layers in vector format that need to be converted to raster. The data layers to convert are 1) a polygon vegetation map classified as forest, grassland, and chaparral, 2) a line map of trails, and 3) a point map of 87 field plots characterizing the abundace of Yellow Starthistle. 2.2 Import the vector dataYou should create a Lab 5 folder in the computer's local E:/Workspace. Download the following lab5.zip archive. This contains several coverages and one Dbase table in a folder called pepperwood. We are going to start this section by importing a series of Arc/Info coverage feature classes into a personal geodatabase. Begin by opening ArcCatalog. You may have to use the F5 key to refresh ArcCatalog so that it sees the coverages in the pepperwood folder. Create a new geodatabase in your Lab 5 folder (you did this in Lab 4 ). Rename it "Pepperwood_Geodatabase". Now open ArcTools and find the "Feature Class to Geodatabase (multiple)" tool (hint: search for it in the Index tab of ArcTools). Use the browse button
Use your skills from Lab 4 to import the "vegmap_table.dbf" table into your geodatabase. Preview the table and note the field names. Open the vegmap polygon feature class in your geodatabase and note its field names.
2.3 Symbolize the vector dataOpen ArcMap. We will now load the layers from our geodatabase and symbolize them with some cartographically appropriate colors. Throughout this step, be sure to use feature classes and table from your Pepperwood_Geodatabase, NOT the original coverages or dbf table. Add the vegmap_polygon feature class and the table to your map document. Use your skills from Lab 4 to join the table to the feature class using the common key that you identified in Question 1. Open the feature class symbology tab and chose the Categories, Unique Values symbology option. For value field, choose the VEG_TYPE field. Click the Add All Values button. Deselect the <all other values> option. Considering our lecture on cartographic design, choose appropriate colors for each class by double-clicking on the color patch for each class, and finally click OK. Load the boundary_arc feature class, which delineates the boundary of Pepperwood Preserve. Click the line symbol below boundary_arc layer in the table of contents (TOC). The symbol selector box opens. Choose the Boundary, State symbol in the Symbol Selecter window. Next load the roads_arc feature class. Open the Symbol Selecter and choose the Major Roads symbol. Load the samplepts_point feature class. Just change the color to red. Your layers should look similar to the following screen shot:
2.4 Polygon features to rasterWe will now convert the feature classes to raster layers. In ArcTools, go into Conversion Tools, then To Raster, and select the Feature to Raster tool. For Input Features, select your vegmap_polygon feature class. For the field, we are going to use the vegmap_table.VEG_TYPE field from the joined table (see screenshot below). Direct the output raster to your geodatabase, and call it vegmap_raster_10. Use an output cell size of 10. The units of the cell size are in linear units of the feature class, in this case meters (m). Click OK to run the feature-to-raster conversion tool.
Go to the Layer Properties of your output vegmap_raster_10, then to the Source tab, and answer the following questions:
Go to the Symbology tab for the vegmap_raster_10 and select Unique Values, and Veg_type for the value field (note: the default field is Value). Use the same colors for the different classes that you used for vegmap_polygon. Right-click on the vegmap_raster_10 layer in the TOC and select "Save As Layer File...". This will save your symbology for the raster layer in a small file called a "layer file". We can then symbolize similarly coded rasters with the layer file. By the way, layer files work with feature classes as well. We'll see this in action in the next step. Repeat the Feature to Raster tool steps above to convert vegmap_polygon to a raster with a 50 m cell size. Call the raster vegmap_raster_50. Go to the symbology tab for this raster and click on the "Import..." button. Browse to the layer file (.lyr extension) that you created above. Click OK. The symbolization for vegmap_raster_10 and vegmap_raster_50 should be exactly the same.
Turn on and off the various vegmap polygon and raster layers and use the zoom tools to answer the following questions:
Save your map document. Name it lab5_base_map.mxd. Save another copy of your map document. This time name it lab5_layout_map.mxd For the following map layout, you will need to load another copy of the vegmap_polygon layer. Go to the symbology tab and this time just select Single Symbol symbology. Click on the colored Symbol patch and select "Hollow" in the Symbol Selecter. Make sure that this hollow symbolized vegmap_polygon is on top of the raster layers. Select the Labels tab in vegmap_polygon properties. Check the "Label features in this layer" box and change the label field to VEGMAP_ID. Go ahead and turn off the drawing of all the other layers in the TOC except the hollow vegmap_polygon and the two rasters.
Save your changes to your lab6_layout_map.mxd map document. 2.5 Line features to rasterWe will now investigate the effects of converting linear vector features to raster. We will no longer work with the lab5_layout_map.mxd map document. Open your lab5_base_map.mxd map document instead. Turn off the display of all layers in the TOC and turn on the roads_arc feature class. Use the Feature to Raster tool to convert the roads_arc feature class to a 10-m raster using ROADS_ID as the cell value. Choose a raster name that allows you to remember what you did. Run the tool again to create a 50-m raster. Zoom in on areas to compare the original vector lines to the new raster layers. We will return to these raster road layers in the Vectorization section. 2.6 Point features to rasterWe will now investigate the effects of converting point vector features to raster. Turn off the display of all layers in the TOC and turn on the samplepts_point feature class. Use the Feature to Raster tool to convert the samplepts_point to a raster layer with 10-m cell size. Use SAMPLEPTS_ID as the value field. Repeat the steps to create a raster with 50-m cell size. Be sure to name your layers so that you can tell what you did later. For point data, there can be a considerable amount of precision error when converting vector data layers to raster grids. In this exercise, you will estimate how much the rasterization process offset the location of sampling points. To do this, familiarize yourself with the Measure tool
Using the measure tool and the table below, measure and record the displacement/error due to rasterizing of the samplepts_point feature class for the selected sampling points. You can use a combination of label feature in the samplepts_point properties, select by attributes or the identify tool Question 5:
3.0 VectorizationVectorization is the process of converting raster feature data to a vector format. Continuous raster data (e.g. DEMs) are rarely converted to vector because raster is a superior data model for representing spatial variability of continuous phenomena. An exception to this example would be the conversion of a DEM to a TIN or vector elevation contour lines. As with rasterization, there are three possible types of conversions.
To examine the effect of vectorization from rasters, we will use our output rasters from Section 2. 3.1 Raster to polygon featuresTurn off the display of all layers in the TOC...you can do this quickly with a right-click on the data frame, then "Turn All Layers Off". In ArcToolbox, go to the Conversion Tools, then From Raster, then select the Raster to Polygon tool. For the input raster, select your vegmap_raster_10 raster layer. Use Veg_type as the field. Put your output polygon feature class in the Pepperwood_Geodatabase and give it a logical name, like "vegmap_raster_10_to_polygon". There is an option to "Simplify polygons". This will smooth the boundaries of the output polygons, reducing their "stair-stepped" appearance resulting from the raster cells. Uncheck this box--we will not use this feature for now. Click OK to run the tool. Repeat these steps for the vegmap_raster_50 raster layer.
By completing the table below, compare the area of each land-cover type as represented in the original vegmap_polygon feature class and the polygon feature classes vectorized from the 10-m and 50-m rasters. To summarize the areas in the cover types, open the attribute table for each feature class, then select the Veg_type field, and right-click select Summarize. Use Veg_type as the field to summarize, and then select the Sum of Shape_Area for the summary statistic. Save your output to a Dbase file (.dbf) outside of the Geodatabase so that you can open it in Excel (like we did in Lab 2). For the vectorized feature classes, your Summarize window will look like this:
For the original vector layer, use the vegmap_polygon feature class with the joined table. Your Summarize window will look like this:
Combine your area summaries from the exported DBase files into one Excel worksheet and paster your answers into the summary table in Question 6. Your values for area should all be fairly similar regardless of the feature class. Large differences mean that there was a problem. When summarizing the original vegmap_polygon feature class, you can use the AREA or Shape_Area field for the area sum...it produces the same result. Question 6:
For Question 7, refer to the data in the table in Question 6. Students may have answers that vary, so interpret the data that you have in YOUR table and you will get full credit for Question 7.
3.2 Raster to line featuresTurn off the display of all layers in the TOC. We are going to vectorize the raster roads from Section 2.5 and compare the output to the original roads_arc feature class. In the Conversion toolbox, open the Raster to Polyline tool. For the Input Raster, select your rasterized roads with a 10-m cell size. For the field, leave the default at Value. For the output polyline features, create a name in your geodatabase (e.g., roads_raster_10_to_line). Switch the background value to NODATA. This tells the tool to treat all No Data values as blank space. Leave the remaining parameters in their default settings. Click OK. Repeat the process to vectorize the roads raster with 50-m cell size.
Summarize the total length of the entire road network for the original roads_arc feature class and the vectorized versions. You can retrieve the sum of the line lengths by going to the attribute table of each feature class, then select the Shape_Length field, and right-click, select Statistics. For the chosen field, this tool provides general statistics (e.g., mean, min., max, sum) from the records in the feature class (e.g., the lengths of each road line segment). These statisics can be selected and copied into your answer for Question 8.
Question 8:
4.0 ConclusionsIn this lab your began to experiment with the data model transformations and their effects on the orignal data. In particular, rasterization cell size has profound effects on the generalization of vector features. You also found that once a vector layer has been rasterized, one can not expect to retrieve the same shape and length of features in the original data source by re-vectorizing the raster (e.g., vectorization). 5.0 To turn in
Submit electronic files via email to klacefie@sonoma-county.org, with the subject "G387, Lab 5, [your last name]". Text portions of this lab were developed by Dr. Ross Meentemeyer, University of North Carolina at Charlotte. Condensed web version by Matthew Clark, Geography and Global Studies Department, Sonoma State University. This page was last modified on Oct. 13, 2008 by Matthew Clark |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||