Lines to Pixels: Turning Contours into Digital Elevation Models

One of the coolest places I get to visit each year is a cave on the western coast of the Mani Peninsula, which is the homebase of The Diros Project. The archaeological project is a Greek-American collaborative endeavor led by Dr. Giorgos Papathanassopoulos and the Greek Ephorate of Palaeoanthropology and Speleology of Southern Greece. The cave was named Alepotrypa, or “Fox-Hole” Cave, after the hole through which a man and his dog discovered the site in the mid-1900s. It turns out that the cave attracted a lot of attention from Neolithic residents of the area, who deposited all kinds of pots, stone tools, and human bodies in the cave before it was closed off by a wall or roof collapse. Although it was reopened in the 20th century, archaeologists are still finding areas to explore further.

The entrance to Alepotrypa (on the left part of the bay)

The entrance to Alepotrypa (on the left part of the bay)

The cave has been featured in a number of news stories lately, including one from USA Today in February 2012. Even more interesting is the photogrammetry of the cave that our colleagues at the Laboratory of Geophysical – Satellite Remote Sensing & Archaeo-environment (IMS-FORTH) have been working on. Seriously, it is very cool.

I came on board the project in 2011, and since then I have been working on digitizing different aspects of the cave and the surrounding landscape. Although elevation points had already been taken  and contour lines drawn, we had yet to create a digital elevation model using the elevation data. The process of turning contour lines into a DEM is pretty simple, though it requires a bit of time and patience at the front end to turn all those hand-drawn lines into digital features. First, you need to have some kind of basemap that has contours, such as the topo maps that can be ordered for cheap through the Hellenic Military Geographical Service (GYS). Or, you can start with a map like this one:

Basemap of a section of Alepotrypa Cave with contour intervals (all data courtesy The Diros Project)

Basemap of a section of Alepotrypa Cave with contour intervals (all data courtesy The Diros Project)

Next, follow these steps to create a contour shapefile:

  1. Import the base image or map with contour lines into your GIS session.
  2. Georeference and rectify the image using at least three pairs of coordinates (use a first-order polynomial transformation to avoid warping the image).
  3. Create a new polyline shapefile in ArcCatalog that will record your contour lines and import it into ArcMap.
  4. Open the attribute table for the contour shapefile and select “Add Field” from the drop-down menu to create a field for the elevation values. If you have sub-meter values (i.e., decimals), make sure to select “Float” or “Double” as the field type. Otherwise, either “Short Integer” or “Long Integer” will do just fine.
  5. Start an editing session, open the “Create Features” window, and trace over all the contour lines in the image, making sure to record the elevation value for each line in the attribute table.
  6. Save your work periodically (Editor toolbar –> Save Edits), and stop when all the tracing is done.
  7. Finally, check the accuracy of your work! Open the symbology tab and give your shapefile a color scheme that will show if you made any mistakes while entering the elevation values.
Graduated elevation contours in a section of Alepotrypa Cave (data courtesy The Diros Project)

Digitized elevation contours, with graduated color scheme

The next step is where the magic happens: turning those lines into a digital elevation model. If you are starting with points, there are a number of tools that allow you to control exactly how the software interpolates the points to make a raster (e.g., IDW, kriging, or spline).

However, there is really only one tool in ArcGIS that turns lines into a raster: the “Topo to Raster” tool (Spatial Analyst Tools \ Interpolation). Because of the small scale of my particular dataset, I chose an output cell size of 0.10 (10 centimeters). There are a bunch of other specifications you can play around with, but for simple interpolations they aren’t necessary. Next, you can use the DEM to create a hillshade that will give your map a 3-D effect (Spatial Analyst Tools \ Surface \ Hillshade).

Unless you define a specific extent, the software will produce rasters in the shape of the “minimum bounding rectangle” that incorporates all your lines. That wasn’t exactly what I wanted for my raster, so I used a polygon (the shape of the cave outline) to “Clip” the DEM and hillshade (Data Management Tools \ Raster \ Raster Processing).

Now for the final touch: layer the files with the hillshade below the DEM. Open the display tab of the DEM, set the transparency to 25-30%, and change its color scheme to whatever you like best.

DEM and hillshade produced from contour lines (data courtesy The Diros Project)

DEM and hillshade produced from contour lines

Special thanks to Maria Kovalchuck, a volunteer at The Field Museum, who did all the hard work on this project!


One thought on “Lines to Pixels: Turning Contours into Digital Elevation Models

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s