Workshop 2012, no. 2 - Cartography and field data in Arcmap 10

  • strict warning: Only variables should be passed by reference in /home/arf_nkt/mapaspects6/sites/all/modules/webfm/webfm.module on line 2495.
  • strict warning: Only variables should be passed by reference in /home/arf_nkt/mapaspects6/sites/all/modules/webfm/webfm.module on line 2495.
  • strict warning: Only variables should be passed by reference in /home/arf_nkt/mapaspects6/sites/all/modules/webfm/webfm.module on line 2495.
  • strict warning: Only variables should be passed by reference in /home/arf_nkt/mapaspects6/sites/all/modules/webfm/webfm.module on line 2495.
Archaeological Research Facility at UC Berkeley
Cartography with GPS-derived Field Data in Arcmap 10
Thursday Dec 6 2012
N. Tripcevich
If images are absent in the webpage below, please Reload the webpage and allow it to load completely. Make sure your computer has a current web connection.

This is an introductory GIS walk-through where we will create a map from locational data starting with data in a spreadsheet table. Digital spatial data comes in a variety of forms from different instruments. Once your data is in metric units in tabular form (outside the scope of this workshop) the steps in this workshop can help you create a map in Arcmap in the Universal Transverse Mercator (UTM) coordinate system. As this is a very commonplace procedure today's workshop we will go through the steps for creating a publication-quality map from a set of points in a comma-separated value (CSV) table.
  • (5.3mb) contains
    • Arcmap 10.0 MXD file referencing two layers
    • Building footprints shapefile
    • Campus 1m Digital Elevation Model (DEM) and derived hillshading

Also included but not added to the MXD are three comma-separated tables:

  • Locs.csv: contains locations and UTM coordinates
  • Lithics_lab.csv – lithics lab analysis
  • Ceramics_lab.csv – ceramics lab analysis

Note: These are not real data! These data files are based on real survey data from South America, but they've been relocated to false positions to an area where everyone is familiar with the geography and scale: the South-east corner of the UC Berkeley campus. The following exercise uses a table from Lithics lab analysis but the table from Ceramics analysis can be substituted.

Download both of these .zip files and unzip them into a directory on your computer. A folder on the desktop is fine. If you double-click the zip file in Windows it will open but be sure to drag the contents out of the zip file window in order to uncompress them.

While Windows offers partial support for Zip format I recommend installing 7-ZIP on your computer. It's an excellent free and open source program (GNU license) that is much more powerful than built in Zip support.

I. Starting with Tabular data in Excel

 Examining these in Excel

- Open, view the tables
- Look at field names in Excel, note that the column header (fieldnames) are simple text (ASCII, 8 char max). Arcmap is very picky about the top row because these become the field headers in DBF format and therefore they MUST be under 12 characters with no spaces. For best results avoid using symbols such as % as well.
- If necessary, export out as CSV (choose first CSV in Save As... File Format list)
- Close Excel

II. Bringing GPS point data into Arcmap

A. Open Arcmap and load datasets

1. Find the Campus_UTM.mxd file and double-click to open Arcmap.
You will see a layer called "buildings" showing the ARF area of the UC Berkeley campus. The background data in brown is high resolution elevation data acquired from a campus repository in "Digital Elevation Model (DEM) format.

To find elevation data for other regions -- albeit at lower resolution data -- see the USGS Seamless Server for other regions in the US. For other countries try ASTER GDEM (30m) and SRTM (90M) datasets, or use national data sources in those countries.

2. Uncheck the DEM_1m layer

3. See other basemap data by going to File menu > Add Data > Add Basemap...

Look over the choices and select Bing Maps Hybrid

Update: Microsoft now requires a free key for using Bing in Arcmap. Please see these instructions or use a different image layer basemap.

The other basemap choices are also useful: Topographic contains USGS topo sheets at a variety of scales in the US. OpenStreetMap sometimes contains very detailed road information in developing countries where the Bing maps road layer may be relatively empty. The Light Gray Canvas is a nice background for regional scale maps. Any of these layers can be faded into the background by Right-clicking the Basemap group > Properties > Display tab and changing Transparent to something like 50% (assuming the dataframe background is white).

B. Add Locs.csv file to map document

- why doesn’t it show in the Display tab, only in the Sources tab?
Answer: because only spatially referenced data appears in the Display tab.

C. Right click on Locs.csv and choose Add XY Data…

- Add East and North

Do you think Eastings belong as the X coordinate or the Y coordinate? Think about cartesian space.

- choose a Coordinate System (use Projected, NAD 1983, UTM Zone 10 North).

D. These data become Events, which are spatial but they are not Shapefiles (you're almost there...)

They must be saved out to Shapefiles.

- Right click Locs_event > Data... > Export Data > Shapefile... and call the file "Locs_shape"
Note that you've only saved one shapefile but this actually creates 4 to 7 files if you browse the folder in Windows with names like "Locs_shape.shp" and "Locs_shape.shx"
- Add the Shapefile to your map.
- Change the color of the dots by right-clicking the Layer Locs_shape, going to Properties, and then choosing the Symbology tab. Click the dot under Symbol to change it.
- Choose a bright color that stands out against the imagery. You can choose a pre-defined symbol from the palette, but note that they're quite large. Choose a simple one that you like, but be sure to reduce the symbol size to 5.

GPS software frequently allows you to export directly to Shapefile so converting from table CSV may not be an issue.

If you map lines and polygons, you will probably need to be able to convert directly to Shapefile from the GPS software. However, it's possible to bring in polygons and polylines just using GPS points where the points are converted to become vertices in a larger geographical object.

Arcmap can convert from Garmin GPX format and from Google KML/KMZ format under ArcToolbox > Conversion Tools > From GPS (GPX) or From KML...

If you want to skip this step II you can just download the Shapefile, unzip, and add to your project.

III. Symbolizing data from the Attribute Table

All records in a Shapefile also appear in the Attribute Table for that Shapefile. In this exercise we will only briefly explore the Attribute Table but note that there are many important aspects to data management in archaeology that involve Attribute Tables (for example, handling One to Many relates). These were covered in more detail in my Spring 2008 ARF GIS Workshop, and that workshop uses these same practice data.

Here, the focus is on map production so we will not do much data manipulation.

A. Visit tabular data behind the map display.

- Right click on the layer name (Locs) and choose "Open Attribute Table".

Note that the LocID field is a unique identifier for each point, while the Descrip field contains nominal classes A, B, or C. Think of these as values that you might log in the field with your GPS.

The goal here is to make a map that displays those Descrip field classes in a useful way.

B. The simplest mapping: For display purposes, let's highlight all the "B" values

It's easy to select contiguous rows in the table and they appear highlighted in the map view. But how to get all the B values to be grouped together?

Currently it's sorted by LocID number.

- right click the field label Descrip and choose Sort Ascending.

- scroll down the list until you see the first B value

- click in the left-most column (a blank column) to select a row and hold the mouse button down and move down the list

- stop when you get to the end of the Bs.

Note that you can add and remove from your selection by holding down the "Control" key.

Move the Attribute table window out of the way and note that you can immediately see where the "B" classes are.

[As an aside, there are other ways to select by an Attribute, such as in the Options... menu at the bottom of the Attribute Table choose "Select by Attribute".]

- Unselect to revert back to the original state by going to the Selection Menu and choosing "Clear Selected Features"

C. Mapping symbology to Classes

The three classes in the Descrip column can be assigned specific symbols to make mapping clearer.

- Right-click the Locs layer and choose Properties...

- Choose the Symbology tab and select Categories from the left side list

- Under Value Field choose Descrip

- At the bottom of the window click "Add All Values".

Note the colors automatically chosen - are they distinct enough? You can uncheck the <all other values> row.

- Double-click the colored dots and choose different symbols for them, but make sure to make them small (size 4 or 5) as the default symbols are large.

As an aside: when you have many different values with sub-groupings you can aggregate them and manage them together by Shift-selecting here, then right-clicking and choosing Group. That isn't relevant here with our simple 3 class data.

There is a lot of power in Arcmap's Symbology system, and you can read more about it in the ESRI Online Help - Drawing Features and Symbolizing Categories (opens in new window). There are many ways to symbolize quantitative data as well -- something we don't cover in this Workshop.

D. Labeling points

Here we will label points by a field such as LocID

- Right click the layer Locs, go to Properties, and go to Labels

- Check "Label features in this layer"

- For Label Field choose LocID

 - Click Apply (this leaves the window open) and look in the background -- what do you think? 

The labels are a bit large and hard to read against the background.

- Click "Symbol...", Click "Properties..." then click the "Mask" tab.

- Select Halo and make it a size of 1.5

- Click OK, OK then Click Apply again.

Play with these settings until you get labels that are readable given the crowded points. Your current zoom level will determine the appropriate size.


IV. Cartographic output

A final map was produced by going from Data Mode to Layout Mode.

- Turn off the Bing Maps. Background imagery is often distracting so we'll make a map using only topographic data from the ucb_hillshd and ucb_elev layers.


A. Layout Mode

- Click on the Layout button on the bottom-left of the map pane.This small button is important because it allows you to switch between between Arcmap data layout mode and page layout mode.

Display and Layout buttons

There is another Arcmap toolbar known as "Layout" that is used for panning and zooming on the page layout. This is an important distinction. The zoom/pan tools you used before will continue to move your overall data set. Experiment with Zoom on the two toolbars to learn how they differ.

Layout Mode is like Print Preview in some ways. You can see the border of your printed page, and you can determine how your map symbology scales to the page. The printed page size and dimensions are defined in File > Print and Page Setup...

- Zoom in so only one area data points is showing and choose the appropriate page direction (Portrait or Landscape) to fit them on a page.

B. Add Legend

- Choose Insert > Legend (only available in Layout mode)

- Use the arrows to move all Legend Items over to the left "Map Layers" except Locs and Buildings

- Leave the defaults for the rest of the legend.

- Under Legend Frame choose Border: 1 px, Background: white (scroll the list down)

- Leave defaults for the rest of the Wizard (next, next)

This legend is "Live" in that it is still connected to your data. If you change a symbol color, the legend will update immediately. This limits your ability to tweak the appearance, however, so often one ends up breaking the Live legend and converting it to graphics.

- Right click the Legend and choose "Convert to Graphics"

- Right click again and choose "Ungroup"

- Click on "Descrip" and press the Backspace key on your keyboard.

- Make other modifications if you wish.

Note that the Right-Click menu has useful tools when multiple objects are selected -- for example, "Align" (use is obvious) and "Order" to reach behind one graphic to reach another.

 C. North Arrow and Scale

Cartographers will tell you that this is not a map without a north arrow and scale!  It's just a diagram until these features are added to give it bearing and relative size in the real world.

The North Arrow is simple, just choose one you like and drag the corner to resize and position. Note that north arrow design can convey information about whether it refers to magnetic or true north.

The Scale bar often requires more tweaking.

- Choose a Scale bar by appearance. Resize it to the approximate space you have available.

How many divisions can you realistically include? Have it fall on a round number.

For example, if the scale bar goes to 8 units, change it slightly so it goes to 5 or 10.

If it goes to 10, lets adjust the subdivisions so they're appropriate.

- Right click and change Number of Divisions to 2, and number of subdivisions to 0.

- You may change the units from Meters to Km or Feet or Miles.

- Under the Numbers and Marks tab change the Frequency to "Divisions".

If you click Number Format you can adjust the size and spacing of numbers.

The scale bar simply takes some trial and error.

D. Including a grid or graticule

- Right click Layers... > Properties, then click Grid tab. Choose Measured Grid to add UTM grid or Gradicule to add the Lat/Long grid.

- It is often easiest to accept the defaults, see how the grid looks, then go back in and adjust it.

Common tasks include

- Turning the right and left labels to Vertical orientation. I often turn off the Bottom and Left labels because they can interfere with Figure captions in text.

- If you click "Additional Properties" in the Labels tab, then "Number Format" you can get rid of the Zeros after the metric distance (lower the number of decimal places).

- Under Lines you can turn off the grid lines by choosing "Do not show lines or ticks"

E. Output Formats

PDF files are a good way to digitally distribute maps from Arcmap.

- users can zoom in on PDF files, and vector file format and font quality is preserved (unlike JPG, TIFF, PNG).

- output a high resolution PDF (400-600 dpi) to distribute and print.

- output an EPS file to place in a Word Processor for high res output to a Postscript device or PDF. EPS is a good format to use for map figures included in reports (theses) distributed as PDF or for publication.

V. Interpolating Contour Lines

Turn off background layers except DEM_1m and ucb_hillshd (turn off ucb_elev). You can see how this is the shaded relief. Next turn off ucb_hillshd and turn on the ucb_elev DEM layer. This elev layer provides high resolution elevation data for generating contour lines. This is Raster data or continuous data and it consists of cells wherein every cell contains the metric elevation (use the Info tool, the blue "i" to query a point by clicking).

  1. To generate contours from the ucb_elev layer you must first make sure Spatial Analyst extension is turned on under Customize Menu > Extensions.... 
  2. Next use the tool ArcToolbox > Spatial Analyst > Surface > Contour ...
  3. In the Contour tool dialog choose ucb_elev as the Input Raster, leave the Output file to the default location in default.gdb (incidentally I've found it's a good idea to output to default.gdb like a temp directory then copy data out from there into your proper directory structure for stuff you want to keep).
    For contour interval choose 5 (meters)
  4. Be patient, interpolating contours is a lot of work. Watch the lower-right corner of your Arcmap screen for a green status message and finally a green Check box.
  5. These can be labeled by right-clicking then Properties > Label tab then check Label and choose Contour field. Other settings in here like a 1.5pt mask (text style) behind the number and Placement Properties position > On-the-line... creates a more standard contour labeling method.