Amherst College I.T. I.T. home. Amherst College.
I.T. home.
ATS > Software > Geographic Information Systems > Editing Map Data

Geographic Information Systems

Editing Map Data

Previous: Mapping Raster Data



Vector data such as points, lines, and polygons can be extracted, created, and edited using ArcMap and ArcCatalog. This is useful to, for example, save a copy of a feature selection from a shapefile or "trace" features on a scanned map.

Topics

Procedures

 

  1. Selecting Map Features on the Map

  2. Selecting Map Features in the Attribute Table

  3. Selecting Map Features by Their Attributes

  4. Duplicating and Reprojecting All or Part of a Feature Set

  5. Creating an Empty Shapefile

  6. Adding a New Field to a Shapefile's Attribute Table

  7. Deleting a Field From a Shapefile's Attribute Table

  8. Working in Editing Mode

  9. Adding New Features to a Shapefile

  10. Deleting Features From a Shapefile

  11. Modifying the Attributes of Features in a Shapefile

  12. Modifying the Geometry of Features in a Shapefile


Getting Started

Since this tutorial will be using specific maps and data, the first step is to make your own copy of the tutorial data.

Set Up: Getting the Tutorial Data

  1. In the Windows Explorer, navigate to the network drive  K: (aka \\Software\Winsoft), open the folder  Maps, and then open the folder  Introduction to GIS.
  2. Drag the folder  editingmapdata and its contents to either:
    1. your network drive  U:, e.g. into the folder  My Documents; or
    2. the local hard drive  C:, e.g. onto your Desktop.

The folder  editingmapdata contains the following files:

 states.shp  cities.shp

Since some — but not all — of the ArcGIS components have trouble handling names with spaces or special symbols, do not rename the folders or files.

Set Up: Initializing ArcMap and Adding the States Layer

  1. Start up the  ArcMap software (see Constructing and Sharing Maps for details).
  2. In the toolbar Standard, click on the button Add Data Icon Add Data.
  3. In the dialog Add Data, navigate into the folder  editingmapdata; if necessary, make a new connection to it first (see Constructing and Sharing Maps for details).
  4. In the folder  editingmapdata, click on the file  states.shp.
  5. Click on the button Add.

ArcMap will now display the map of the United States that we saw before:


Selecting Map Features

Before you can edit map features, you must first select the ones you want!

ArcGIS provides a number of ways to search for and select different parts of a layer's data.


Selecting Map Features on the Map

When you select features on a map, they will be highlighted with an aqua-colored outline, making them easy to distinguish from the others.

Procedure 1: Selecting Map Features on the Map

In ArcMap Icon ArcMap:

To select a single map feature*:
In the toolbar Tools, click on the tool  Select Features(if necessary). Then, click on a map feature.
To select multiple contiguous map features:
In the toolbar Tools, click on the tool  Select Features(if necessary). Then, click and drag the cursor across multiple feature. Note that this displays a rectangle on the map, and any feature that intersect the rectangle will be selected.
To select multiple noncontiguous map features:
In the toolbar Tools, click on the tool  Select Features(if necessary). Then, click on the first feature (if there isn't one already selected). Now hold down the Shift key, and click on additional features.
To deselect specific map features:
In the toolbar Tools, click on the tool  Select Features(if necessary). Then, hold down the Shift key, and click on the features you want to deselect.
To deselect all map features*:
In the toolbar Tools, click on the tool  Clear Selected Features.
To zoom in to all selected map features*:
In the menu Selection, click on the menu item  Zoom To Selected Features.
To zoom in to selected map features in a single layer:
In the Table of Contents, right-click on the layer's name. In the contextual menu that appears, point at the menu item Selection. In the submenu that appears, click on the menu item  Zoom To Selected Features.

*These items are also available in a contextual menu that appears when you right-click on a map feature or the map itself (as appropriate)


Selecting Map Features in the Attribute Table

ArcMap maintains a direct link between the description of a feature in an attribute table row and its representation in the map. Therefore, when one is selected, so will be the other.

Experiment: Make sure that some features are selected on the map. Then, open the attribute table as described in Constructing and Sharing Maps (if it isn't already open). Move the attribute table around or resize it (click and drag on its edges) so you can see all of the states on the map. Scroll through the table until you come to those features' records; how are they distinguished from the others?

Procedure 2: Selecting Map Features in the Attribute Table

Before selecting features in the attribute table, you may find it useful to sort the records as previously described.

In ArcMap Icon ArcMap, in a layer's Attributes table:

To select a single map feature:
At the left end of one record, click on the button  Select Record.
To select multiple contiguous map features:
At the left end of one record, click and hold on the button  Select Record. Then drag down the list to select multiple records.
 
Or: At the left end of one record, click on the button  Select Record(if necessary). Then hold down the Shift key and click on another button  Select Record, to select everything in between.
To select multiple noncontiguous map features:
At the left end of one record, click on the button  Select Record(if necessary). Then hold down the Ctrl key and click on another button  Select Record. Note that this key is different than the one used for the same purpose on the map itself, but similar to the way that Excel functions.
To deselect specific map features:
At the left end of the record you want to deselect, hold down the Ctrl key and click on the button  Select Record. Note that this key is different than the one used for the same purpose on the map itself, but similar to the way that Excel functions.
To deselect all map features in this layer:
At the left end of one of the selected records, right-click on the button  Select Record. In the contextual menu that appears, click on the menu item  Clear Selected.
To zoom in to all selected map features:
At the left end of one of the selected records, right-click on one of the buttons  Select Record. In the contextual menu that appears, click on the menu item Zoom To Selected.
To display only the selected map features in the table:
At the bottom of the table, click on the button Show: Selected. Click on the button Show: All to restore the complete list.

Selecting Map Features by Their Attributes

An important property of ArcGIS is its ability to select features in a general way based on their attributes.

This is particularly important when you have a large number of records or if you can't visibly distinguish them.

Field MenuProcedure 3: Selecting Map Features by Their Attributes

  1. In ArcMap Icon ArcMap, in the menu Selection, click on the menu item  Select By Attributes….
  2. In the dialog Select By Attributes, in the menu Layer:, make sure the layer from which you want to select features is displayed, e.g. states.
  3. In the menu Method:, choose what you want to do with the features you'll select:
    • Create a new selection
    • Add to current selection
    • Remove from current selection
    • Select from current selection
  4. In the field SELECT * FROM layer WHERE:, click and define a logical expression, or query, to choose the features you want. 
  5. Queries can be very specific, using any of the attribute values provided in the table.

    In the example shown, the attribute "SUB_REGION" is used to select any state on the eastern seaboard by combining the three possibilities with OR. These are grouped with parentheses, and the resulting set is then limited by the AND statement that requires their attribute "POP00_SQMI" to be greater than or equal to 200 people per square mile.

    When defining a query:

    • To see all possible values for an attribute, click on its name in the attribute list, and then click on the button Get Unique Values.
    • You can use any combination of:
      • clicking on operator buttons such as Or and >=;
      • double-clicking on attribute names or attribute values;
      • typing (note that attribute names have double quotes around them while attribute values have single quotes around them).

      Clicked items are inserted at the position of the text cursor.

    • Typing the key Enter (not the one on the numeric key pad), will break lines to make your query more readable.
    • You can check that a query has the correct syntax by clicking on the button Verify.
  6. When you are finished defining your query, you can click on either of the buttons Apply or OK to see its effect.

Duplicating and Reprojecting a Feature Set

The most basic form of editing is to duplicate a feature set in whole or in part; at the same time, you can reproject it.


Duplicating Features with ArcMap

Quite often you will want to make your own copy of a data set.

This can be useful if you only need to work with one part of a much larger data set, or if you are using a server's data and need to modify it.

In the same process, ArcMap lets you reproject the data into the spatial reference of the data frame, if you so choose.

Procedure 4: Duplicating and Reprojecting All or Part of a Feature Set

  1. If you only want to duplicate part of a data set, first select those features as previously described, or change your view of the map to include just those features.
  2. If you want to reproject a data set, change the data frame's spatial reference to the desired one.
  3. In ArcMap Icon ArcMap, in the Table of Contents, right-click on the name of the layer, e.g.  states.
  4. Right-click on the layer to open its contextual menu, point at the menu item Data, then in the submenu that appears click on the menu item Export Data….
  5. In the dialog Export Data, in the menu Export, choose which part of the data set you wish to duplicate:
    • All features (the default when nothing is selected)
    • Selected features (the default when something is selected)
    • All features in the View Extent (i.e. those features currently visible in the map window, in whole or in part)
  6. In the button set Use the same coordinate system as:, choose between retaining this layer's source data (the default) or using the spatial reference of the data frame.
  7. Near the text field Output shapefile or feature class::
    1. Click on the button Document Open Browse;
    2. In the dialog Saving Data, navigate to an appropriate location for the new data set, e.g. the folder editingmaps;
    3. Give the new layer a descriptive name, e.g. Populous Atlantic States.shp;
    4. Click on the button Save.
  8. Click on the button OK.
  9. The dialog ArcMap will now appear, asking if you want to add the exported layer to the map; click your preference Yes or No.

You can also duplicate an entire data set in ArcCatalog, and often change its format.


Creating and Editing Features

ArcGIS has a complete set of editing tools that can be used to both create features, modify their shape, and change their attributes.


Creating a New Empty Feature Set with ArcCatalog

Recall that ArcCatalog is the program for establishing the basic characteristics of a data set, e.g. its projection.

It will probably be no surprise, then, that you will also use ArcCatalog to create new shapefiles from scratch.

Procedure 5: Creating a New Empty Shapefile

  1. Start ArcCatalog:
    • If you are already in ArcMap Icon ArcMap, look in the toolbar Standard and click on the button ArcCatalog.
    • Otherwise:
      1. Create New Shapefile Dialog Click on the menu Start Menu Icon Start;
      2. Point at the menu item All Programs;
      3. If you are in the public labs, point at the menu item Folder Icon Course-related;
      4. Then point at the menu item Folder Icon ArcGIS;
      5. Click on the menu item  ArcCatalog.
  2. In  ArcCatalog, in the left pane, navigate to the folder where you want to create the new feature set, e.g. the folder editingmaps.

    If necessary, make a new connection first by going to the toolbar Standard and clicking on the button Connect to Folder Icon Connect to Folder.
  3. Right-click on the target folder and, in its contextual menu, point at the menu item New, and then in the submenu that appears click on the menu item  Shapefile….
  4. In the dialog Create New Shapefile, in the field Name:, type in the name of your new shapefile, e.g. houses.
  5. In the field Feature Type:, choose the type of shapefile, Point, Polyline, Polygon, etc.
  6. In the area Spatial Reference, click on the button Edit….
  7. In the dialog Spatial Reference Properties, define the new shapefile's spatial reference (see Mapping Geographic Coordinate Data for details), e.g. NAD_1983_StatePlane_Massachusetts_Mainland_FIPS_2001.
  8. Back in the dialog Create New Shapefile, click on the button OK.

An empty shapefile will need to have features added to it, and usually this will occur in the conjunction with another layer from which you can extract information.

Exercise: Preparing a Shapefile for Editing

The first step in creating a new shapefile is having a good background layer to compare with; you'll use an orthophoto of Amherst here.

  1. Return to ArcMap:
    • If it's already running, switch to it, look in the toolbar Standard and click on the button Add Data Icon New Map File;
    • If it's not already running and you are still in ArcCatalog, look in the toolbar Standard and click on the button ArcMap.
  2. In the toolbar Standard, click on the button Add Data Icon Add Data.
  3. In the dialog Add Data, navigate into the folder  K:\Maps\Local Data\Amherst\Orthophotos; if necessary, make a new connection to it first (see Constructing and Sharing Maps for details).
  4. In the folder  Orthophotos, click on the file  amherst_2004.sid.
  5. Click on the button Add.
  6. Zoom into the area of Amherst College (slightly northwest of center).
  7. Now add the empty shapefile by again clicking on the button Add Data Icon Add Data, navigating to the folder  editingmaps, and adding the shapefile you created in Procedure 5 above,  houses.shp. You will use it to mark the locations of several residence halls on campus.

Adding and Deleting Attribute Table Fields

By default, a new shapefile has only the minimal number of attributes: its field identifier (FID), its geometry (Shape), and a default integer Id field to ensure that there is at least one additional field present. One of the first things you'll want to do is add another field to hold your own descriptions of the records.

Important Note: Unlike spreadsheets such as Excel, database programs like ArcMap treat rows (records) and columns (fields) as very distinct structures. Therefore, you cannot add fields to or delete fields from a shapefile when you are in the record-oriented Editing mode (described subsequently).

Procedure 6: Adding a New Field to a Shapefile's Attribute Table

  1. In ArcMap Icon ArcMap, open the shapefile's attribute table as described in the document Constructing and Sharing Maps in the procedure Viewing a Map Layer's Attribute Table.

    Note that you can also modify the attribute table in  ArcCatalog, in the shapefile's Preview page.
  2. In the dialog Table, click on the button  Table Options, and in its menu click on the item Add Field….
  3. In the dialog Add Field, in the field Name, type in a name for the field, e.g. HOUSE_NAME.
  4. Remember the limitations on field names described in Mapping Place Name Data in the procedure Making an Excel File Compatible with ArcGIS, Step #1.

  5. In the field Type, choose a data type for the field, e.g. Text. The available data types are described in Mapping Place Name Data in the section Making Attribute Fields Compatible.
  6. In the area Field Properties, you can specify the size and other properties of the field, e.g. the number of characters in a text field.
  7. Click on the button OK.

Now that you have added another field to your shapefile, the integer field Id is no longer necessary, so unless you have a need for such a field, it's a good idea to clean up your attribute table by deleting it.

Procedure 7: Deleting a Field From a Shapefile's Attribute Table

  1. In ArcMap Icon ArcMap, open the shapefile's attribute table as described in the document Constructing and Sharing Maps in the procedure Viewing a Map Layer's Attribute Table.

    Note that you can also modify the attribute table in  ArcCatalog, in the shapefile's Preview page.
  2. In the layer's Attributes table, right-click on the header of the field that you want to delete, e.g. Id.
  3. In the contextual menu that appears, click on the menu item  Delete Field.
  4. In the dialog Confirm Delete Field, click on the button Yes.



Editing Features in a Shapefile

Important Note: Unlike spreadsheets such as Excel, database programs like ArcMap treat rows (records) and columns (fields) as very distinct structures. Therefore, you must exit the record-oriented Editing mode before you can add fields to or remove fields from the attribute table of a shapefile.

Procedure 8: Working in Editing Mode

A map document can bring together a large number of different layers and errors can accidentally affect a large number of features; therefore editing of a layer occurs in a separate Editing mode that requires a bit of preparation.

  1. In ArcMap Icon ArcMap, in the toolbar Standard, click on the button  Editor Toolbar.
  2. The Editor Toolbar will appear; you can dock it in a convenient location if you want:
  3. In the toolbar Editor, click on the button Editor, and in its menu click on the button  Start Editing.
  4. If there is more than one folder of editable data in your map, you will be presented with the dialog Start Editing and forced to choose a subset to work on:
    1. In the list Which folder or database do you want to edit data from?, make sure that the correct folder is selected, so that the shapefile you want to edit appears in the field These layers and tables currently in your map reside in the source selected above:.
    2. Click on the button OK.
  5. In the toolbar Editor, in the menu Target, make sure that the layer you want to edit is selected, e.g. houses (important if there is more than one file in the folder).
  6. As when working on documents in most other programs, any changes you make in Editing mode will not be saved until you explicitly do so.

    Therefore, whenever you are satisfied with the changes you have made, go to the toolbar Editor, click on the button Editor, and in its menu click on the button  Save Edits.
  7. While editing, if you want to switch to a different shapefile, and:
    • it's in the same folder, return to Step 5;
    • it's in a different folder, continue to Step 8 and then start this procedure from the beginning.
  8. When you are finished editing records, go to the toolbar Editor, click on the button Editor, and in its menu click on the button  Stop Editing.
  9. If you have not yet saved your edits, the dialog Do you want to save your edits? will appear; answer the question by clicking on one of the buttons Yes or No, or Cancel to return to editing.

You will now add points for a few of the houses you recognize in the Amherst orthophoto; this campus map might be helpful.

Procedure 9: Adding New Features to a Shapefile

  1. In ArcMap Icon ArcMap, make sure you have added the shapefile you want to modify, and start editing as described in Procedure 8, Steps 1-5.
  2. Click on the button  Sketch Tool; the cursor will change to a transparent aqua circle with crosshairs.
  3. All features in shapefiles are described by one or more points, which for polylines and polygons are called vertices since they connect line segments. Polygons differ from polylines by always connecting the last point to the first point.

    Click anywhere on the map to start creating the feature, called a sketch, and a tiny red square will appear to mark this point; if the feature is:
    • a point, a single click is all you need;
    • a polyline or polygon, click once for each additional vertex, except double-click for the last vertex.

      Note that when you create a new vertex, the previous vertex turns green.

    If you make a mistake, press the key Ctrl-Z to undo the most recent click, or the key Ctrl-Delete to delete the current sketch in its entirety.

  4. If you want, save your new feature as described in Procedure 8, Step 6.
  5. If you want to add additional new features to this shapefile, repeat Steps 3 and 4 for each one.
  6. Stop editing as described in Procedure 8, Steps 8 and 9.

Just for practice, delete two of the house points you just created, one from the map and one from the attribute table:

Procedure 10: Deleting Features From a Shapefile

  1. In ArcMap Icon ArcMap, make sure you have added the shapefile you want to edit, and start editing as described in Procedure 8, Steps 1-5.
  2. To delete a feature:
    • When you see the feature on the map:
      1. In the toolbar Editor, make sure that the  Edit Tool is selected.

        Note that this is the same as the tool  Select Featuresin the toolbar Tools, but it's different from the tool  Select Elementsin the toolbars Standardand Drawing.
      2. Click once on any part of the feature you want to delete.
      3. Press the key Delete.
    • When you see the feature in the attribute table:
      1. At the left end of the record, click on the button  Select Record.
      2. Press the key Delete.
  3. If you want, save your changes as described in Procedure 8, Step 6.
  4. If you want to delete additional features in this shapefile, repeat Steps 2 and 3 for each one.
  5. Stop editing as described in Procedure 8, Steps 8 and 9.

Now edit the attribute table of the house features you've created, to add their names:

Procedure 11: Modifying the Attributes of Features in a Shapefile

  1. In ArcMap Icon ArcMap, make sure you have added the shapefile you want to edit, and start editing as described in Procedure 8, Steps 1-5.
  2. In the Table of Contents, right-click on the name of the layer whose attributes you want to modify, e.g.  houses.shp.
  3. In the layer's contextual menu, click on the menu item  Open Attribute Table.
  4. In the layer's Attributes table, locate the feature record you want to modify. You may find it helpful to move the table around so you can see the map and select the feature there as described in Procedure 2.
  5. In that features's record, double-click in the field you want to modify, and type its new value.
  6. If you want, save your changes as described in Procedure 8, Step 6.
  7. If you want to modify additional features in this shapefile, repeat Steps 4, 5, and 6 for each of them.

    Note that, like Excel, you can press the key Enter to move to the same field in the next record, or Shift-Enter to move to the previous record.
  8. Stop editing as described in Procedure 8, Steps 8 and 9.

Sometimes you will want to make changes to the geometry of a feature, either as a whole or to individual vertices.

Procedure 12: Modifying the Geometry of Features in a Shapefile

  1. In ArcMap Icon ArcMap, make sure you have added the shapefile you want to edit, and start editing as described in Procedure 8, Steps 1-5.
  2. Make sure that the  Edit Tool is selected, and then:
    • If you want to move the entire feature:
      1. Click on it once and wait for it to be selected;
      2. Click on it again and drag it to its new position.
    • If you want to move a vertex of a polyline or polygon:
      1. Double-click anywhere on the feature; its outline will change to an aqua-highlighted thin line, and its vertices will appear as small green and red boxes.
      2. Point the cursor at the vertex you want to change, and wait for the cursor to change to a box with triangles on each side.
      3. Click and drag the vertex to its new position; the aqua-highlight will remain in its original location.
      4. Click anywhere away from the sketch to see the effect of the change.
    • If you want to delete a vertex of a polyline or polygon:
      1. Double-click anywhere on the feature; its outline will change to an aqua-highlighted thin line, and its vertices will appear as small green and red boxes.
      2. Point the cursor at the vertex you want to delete, and wait for the cursor to change to a box with triangles on each side.
      3. Right-click on the vertex, and in its contextual menu click on the item Delete Vertex.
      4. Click anywhere away from the sketch to see the effect of the change.
    • If you want to insert a new vertex into a polyline or polygon:
      1. Double-click anywhere on the feature; its outline will change to an aqua-highlighted thin line, and its vertices will appear as small green and red boxes.
      2. Point the cursor at the spot along the outline where you want to add the vertex, and wait for the cursor to change to a four-way arrow.
      3. Right-click on the outline, and in its contextual menu click on the item Insert Vertex.
      4. Click anywhere away from the sketch to see the effect of the change.
    • If you know the coordinates you want to assign to an existing point or vertex:
      1. Double-click anywhere on the feature; its outline will change to an aqua-highlighted thin line, and its vertices will appear as small green and red boxes.
      2. Either:
        • Point the cursor anywhere along the sketch and right-click on it, and in its contextual menu click on the item  Properties…; or
        • In the toolbar Editor, click on the button  Sketch Properties.
      3. In the dialog Edit Sketch Properties, one vertex will be selected, and in the sketch it will appear as a hollow square. In a polyline/polygon you can click on another vertex, or use the up and down arrow keys to move along the sketch.
      4. Click on the coordinate(s) of the point/vertex you want to change, and type in the new value(s).
      5. Click on the button Finish Sketch.
  3. If you want, save your changes as described in Procedure 8, Step 6.
  4. If you want to modify additional features in this shapefile, repeat Steps 2 and 3 for each one.
  5. Stop editing as described in Procedure 8, Steps 8 and 9.

Exercise: Creating a Line Shapefile

Locate the Fort River just to the south of Amherst's campus, and create a line shapefile that follows its course through the orthophoto.

 

 


Previous: Mapping Raster Data

Editing Map Data

 

Top of Page  | Using IT DocumentationIT Home  |  IT Site Map  |  Search IT