You are on page 1of 6

CPAS Archaeological GIS Workshop December 2009 Chengdu, China

Dr. Jason Ur Department of Anthropology Harvard University

Lab 5: Creating Vector Data


In Lab 5, you will derive vector features (points, polylines, and polygons) from your growing raster dataset for the Gucheng area. You will identify classes of features to be digitized from these sources and then create shapefiles to contain them. This process can be done either manually (i.e., placing the vertices of each feature by the click of a mouse) or, in the case of polyline tracing, automatically, using the ArcScan extension. Introduction: Creating Vector Data in ArcMap A. All sorts of geographical features can be represented using the vector data model, based on raster data, including scanned and georeferenced maps, downloaded satellite imagery, and published archaeological maps and plans. The three vector data types (point, polyline, polygon) are appropriate for different types of features. B. A non-exhaustive set of examples: 1. Point features: a) Locations of sites and modern towns, on small-scale maps; b) Springs or wells, from maps; c) Spot elevations, from large-scale topographic maps 2. Polyline features: a) Modern roads (important for survey logistics!) b) Ancient roads, tracks, or canals; c) Topographic contour lines; d) Watercourses (natural or artificial) 3. Polygon features: a) Areas of modern settlements, on large-scale maps and imagery; b) Areas of archaeological sites, on large-scale maps c) Bodies of water d) Areas of distinct land use (from high-resolution imagery); e) Soils, from georeferenced soil maps, if available II. Creating a new shapefile in ArcCatalog A. Load ArcCatalog and navigate to the appropriate folder on your U: drive. B. From the ArcCatalog menu, select FileNewShapefile C. In the Create New Shapefile window: 1. Give the file a windows-compliant name (no spaces or strange characters) that starts with an alphabetical character; 2. Select the appropriate Feature Type; 3. Assign the UTM zone 48 north projection by clicking the Edit button, and then selecting it. Click OK on the Create New Shapefile window. 4. The shapefile will now appear in the Table of Contents window to the left. D. Add an attribute (field) to the shapefile 1. Right-click the shapefile name and select Properties 2. The Fields tab in the Shapefile Properties window lists the fields and data type for each field. Note that the first three are system fields which are automatically added. 3. Add a field. a) For unique features, this field might include the name of a town, or a site designation; b) For features of varying classes, you can develop coding; for example, a track polyline shapefile might have a numeric field called class which could contain 0, 1, 2, or 3 for unclassified, dirt track, gravel track, or paved road, respectively. c) For example, if you were creating a point shapefile that will contain x,y positions 1 I.

CPAS Archaeological GIS Workshop, Chengdu Dec 2009

Lab 5: Creating Vector Data

of archaeological sites, you might create a field called sitename by typing it into the next available row in the Field Name column. d) In the Data Type field, make sure Text is indicated, and then set the Length in the Field Properties box below. (In this particular case, you should estimate the longest site name and make sure this text field can accommodate it.) e) You can always add more fields at a later time through ArcCatalog. 4. Click OK. E. Add the shapefile to your ArcMap document. 1. This can be done in by clicking the Add Data icon , or 2. You can simply drag the shapefiles icon from the ArcCatalog Table of Contents into the ArcMap table of contents. 3. Make sure that the new layer is above any raster layers; otherwise it will not be visible. Of course, because your new layer does not yet contain any features, you will not notice any change in your map. III. Before creating features, set the editing environment A. ArcMap has a toolbar which contains all of the feature editing tools. To display it, right-click anywhere on the toolbar (at the top of the screen) and select Editor (if it is not already checked and therefore visible).

B. Begin the editing process 1. In the Editor menu, select Start Editing (if you havent already). 2. Make sure that the Target layer is set to the layer to which you want to add features. 3. Note that if you have vector layers from more than one folder, you will be asked to specify the folder that contains the intended edit layer. The Target dropdown box will then be populated with the names of the layers whose corresponding shapefiles exist in that folder. C. Snapping 1. When creating features, the software can automatically snap the vector to the vertices and edges of existing features. In this manner, you can guarantee that the vectors or edges of two features will correspond precisely. 2. In the Editor toolbar, select EditorSnapping. 3. For each layer, you can choose to snap to the vertices, edges or ends of the features of that layer. a) Check the boxes for Vertex and Edge for your layer; also below, under Edit Sketch, check Edit Sketch Vertices b) This last choice will allow you to snap to vertices and edges of features that you are in the process of creating (the edit sketch). This is especially important for enclosed contour lines. c) Close the Snapping Environment window. 4. Adjust the Snapping Tolerance a) To specify the distance within which the cursor should snap to a feature, select Options from the Editor menu. b) On the General tab, set Snapping tolerance to 10 map units. Whenever the cursor comes within 10 m of a features edge or vertex, it will snap to it. c) On occasion, you may wish to either turn off snapping or reduce the tolerance; for example, you may be vectorizing a long narrow beach and find that the cursor is snapping to other features when it should not. d) Click OK. 2

CPAS Archaeological GIS Workshop, Chengdu Dec 2009

Lab 5: Creating Vector Data

IV. Create new features. A. Creating a feature 1. Make sure that Task is set to Create New Feature in the Editor toolbar. 2. Select the Create New Feature tool . 3. Identify a feature from your map or image and create vectors on it or along it. If you are creating polygon or polyline features, double-click on the last point to indicate that the feature is completed. 4. The completed feature will be selected (highlighted with cyan). B. Adding attribute data 1. Your newly created feature now has a shape but no underlying attribute data. 2. While the new feature is still selected, click the Feature Property Editor button on the Editor toolbar. 3. The attributes of the selected feature will be shown. The first two fields (properties) are automatically set, but any other user-defined ones will be blank. 4. Enter the relevant information (site number, road class, etc.) into the Value area next to the property name. 5. You can close this window now, or leave it open to the side as you create new features. The attributes of the selected feature(s) will always be visible in this window. C. Saving your edits 1. The new feature must be saved. To do this, select Save Edits from the Editor menu. It is not necessary to do this after creating each feature, but it is useful to get into the habit of saving your edits periodically. 2. Note that by selecting Save Edits, you are writing to the shapefile itself, rather than just making changes to the layer. To save changes to the layer properties, save the entire map (FileSave). V. Creating Polygon features. There are several tricks or tips for creating polygon features that might save you time, especially if your polygon layer is continuous (e.g., soils, land use, vegetation classification, etc.). A. Autocompleting a polygon 1. To create a feature which shares an edge with an existing feature, it is not necessary to duplicate the shared edge; the software can automatically do this, guaranteeing that the two features will abut each other precisely. 2. Select Auto-Complete Polygon in the Task box on the Editor toolbox. 3. Begin to draw the new feature from its intersection (edge or vertex) with the existing feature, then create vertices along the new feature. You can snap to that point, or you can overlap (see example to right). 4. The final point of the polygon should be on or beyond the edge of the existing feature, and should be double-clicked. 5. ArcMap should automatically close the polygon. 6. For a layer such as a soils layer, where features are continuous, you will probably create the majority of the features using polygon autocompletion. B. Cutting polygon features 1. Occasionally it is easier and more accurate to create a feature that encompasses several map features (soil areas) and then divide (cut) that feature into the discrete soil areas. 2. Create (or Autocomplete) a polygon feature which includes several features (e.g., several soil zones, several contiguous fields). 3. Note that once the new feature is created, you may not be able to see the underlying soil types in order to know where to cut. To solve this problem, turn the soil feature layer partially transparent, or give it a transparent Fill Color. 3

CPAS Archaeological GIS Workshop, Chengdu Dec 2009

Lab 5: Creating Vector Data

a) Open the Properties window for the soil layer and select the Display tab. b) In the Transparent box, type 50 (%). c) On the Symbology tab, it may be useful to increase the outline thickness to 2 or greater and change the outline color to something (such as primary red) which will stand out. d) Click OK to close the Layer Properties window. 4. Select the feature to be cut and select Cut Polygon Features from the Task box. 5. Using the same tool as before , draw a line across the feature to be cut. Your last point should be beyond the feature, and double-clicked.

6. The feature will be cut, and the two new features will be selected. If the Attributes window is visible, note that both new features are listed, and can have their attributes updated at this time. VI. Editing features A. In the Editor toolbar, set the Task to Modify Feature. B. Select the feature to be edited. Note that the vertices appear as squares, one of which will be red. The red vertex is selected and ready to be moved. To select a vertex for editing, click it once with the Edit Tool; it should turn red. C. The selected (red) vertex can then be dragged into a new position. 1. Note that the Edit Sketch is updated (the thin line with square vertices) but not the actual feature. 2. To commit your changes to the Edit Sketch to the feature itself, deselect the feature by clicking anywhere outside it. 3. The feature will now reflect the changes made to the Edit Sketch. D. Combining two features 1. You may want to vectorize large areas in segments. These can then be joined into a single feature. 2. Shift-click the features to be joined with the Select tool 3. In the Editor menu, select Merge. You may want to check the attributes to confirm that the new feature has the correct attribute values. Appendix: Using ArcScan to Automatically Trace Features VII. Creating Polyline Features. The process of digitizing repetitive polyline features, particularly contour lines, is incredibly tedious. ESRI has created an extension tool called ArcScan to semi-automate this process. You can manually create polyline features for things like roads and canals from satellite imagery, but It is highly recommended that you use ArcScan to vectorize contour lines off of georeferenced maps. You can do this either on a feature-by-feature basis, or have ArcScan do the entire map in an automated fashion. A. Prepare to digitize 1. Activate the Spatial Analyst and 3D Analyst toolbars, and make sure that they are 4

CPAS Archaeological GIS Workshop, Chengdu Dec 2009

Lab 5: Creating Vector Data

activated by checking ToolsExtensions. 2. Create a polyline shapefile to hold your contour features. a) Create the shapefile in the UTM 48 north projection; b) Add a numeric field elev of type Double; c) Add the new shapefile to an ArcMap document that already contains the topographic map. B. Tracing contours using the ArcScan extension 1. Enable ArcScan a) In the Tools menu in ArcMap, choose Extensions and make sure ArcScan is checked. Click Close. b) Turn on the ArcScan toolbar by choosing ViewToolbarsArcScan. c) ArcScan works hand-in-hand with the Editing Toolbar, so you must be editing in order to enable it. Choose Start Editing from the Editor menu and set the target layer to your new contours layer. 2. ArcScan Setup a) ArcScan requires that the raster to be traced be bi-level. (1) If your map is in color (i.e., 3 band raster), you will have to work from a single band. Preview the three bands in ArcCatalog and add whichever has the best contrast in the contour lines to ArcMap. (2) Go into the Symbology tab of the Properties for your topo map; (3) Choose Classified and set the number of classes to 2. (4) Click OK. In the ArcScan toolbar, make sure the Raster: is set to your topo raster. b) Set the options by clicking the Raster Snapping Options button . (1) Maximum line width no more than the max width (in pixels) of a countour line; (2) The other variables can be left as is. (3) Click OK. c) Under Snapping in the Editor menu, it is now possible to snap to the contour lines; at the bottom of the Snapping window you can choose to snap to Raster. d) Set the Vectorization settings (1) On the Vectorization menu on the ArcScan toolbar, choose Vectorization Settings (2) These settings determine how frequently ArcScan will create vertices for your auto-vectorized features. You can copy the settings to the right, or (3) Click the Styles button and choose Contours. (4) Click Apply on the Vectorization Settings box and then Close. 3. Create a single feature using ArcScan a) With the Editing task set to Create New Feature, select the Vectorization Trace tool . b) Click on the contour to be vectorized. Note that as you move the cursor over the line, it snaps to it, and changes to an arrow in the direction of vectorization. c) Click a second time on the line. The vectorization will proceed in that direction along the line, and will continue until it reaches the end of the line or requires input from you. d) If the line contains a break larger than 2 pixels, you must manually "leap" over it; 5

CPAS Archaeological GIS Workshop, Chengdu Dec 2009

Lab 5: Creating Vector Data

to do this, hold down the "S" key and click on the opposite side of the break. You can then continue as before. e) When the line is completed, press the F2 button to finish the sketch. You may then add attribute data (e.g., the elevation). 4. Alternatively, vectorize an entire map using ArcScan a) Under Vectorization on the ArcScan toolbar, choose Show Preview. In the resulting preview, potential polylines will be shown as red lines, and potential polygons as blue areas. b) If the preview is unsatisfactory, there are two options. (1) Change the Vectorization settings (see VI.B.2.d above). You can make changes, then click Apply to update the preview. (2) Clean up the raster before vectorizing. On the ArcScan toolbar, choose Raster CleanupStart Cleanup. For more on how to do this, see the ArcScan documentation linked in C. below. c) If the preview is satisfactory, select VectorizationGenerate Features on the ArcScan toolbar. You will be prompted to choose the line layer to which to add centerlines. Click OK to generate polyline features. d) It is likely that many features will be created that do not correspond to contours. You will have to select and delete these features manually. It is up to you to decide whether it is faster to auto-generate features and then manually clean the shapefile, or to manually generate them. e) You may also have to edit some polylines, to join contours, etc. See Section VII below. f) To add attribute data (e.g., the elevation), see section IV.B above. 5. Save your edits frequently, especially after finishing a long or complex topo line; ArcMap has an unfortunate tendency to crash (as many of you have already noticed).

You might also like