Conversion of contoured topography to digital-terrain data

9
Computers & Geosciences Vol. 16, No. I, pp. 101-109, 1990 0098-3004/90$3.00 + 0.00 Printed in Great Britain Pergamon Press plc CONVERSION OF CONTOURED TOPOGRAPHY TO DIGITAL-TERRAIN DATA GREGORY COLE ~, SCOTT MACINNES 2, and JAMES MILLER 3 l Los Alamos National Laboratory, Los Alamos, NM 87545, and University of Arizona, Tucson, AZ 85721, 2Zonge Engineering and Research Organization, Tucson, AZ 85716, and 3 University of New Mexico, Albuquerque, NM 87131, U.S.A. (Received 23 November 1988; revised 25 January 1989; received for publication 21 June 1989) Abstract--High-performance graphics systems coupled with video digitizers provide the capability to obtain digital topography from contour maps. A technique is presented for conversion of contoured data to gridded data. This technique provides a cost-efficient option for obtaining digital topography where such data are not available, for obtaining average elevation data in support of gravity surveys, or for gridding hand-contoured data. The method is interactive, makes use of standard image processing and computer graphics techniques, and requires a user-operator who can read topographic maps. The resultant digital data retain the smooth trends of the contour data and are well within the error limits reflected in the placement of the original contour lines. Key Words: Image analysis, Computer graphics, Digital elevation. INTRODUCTION Digital topography plays an increasing role in the visualization of geologic data, and in the modeling of geologic processes. The production and sale of digital elevation (digital terrain) data by the U.S. Geological Survey as part of the National Mapping Program has promoted the use of this type of data in many geol- ogical applications. Uses of this information include its merging with LANDSAT satellite-acquired digital data to provide oblique views of topographic and land-use features, and its merging with rasterized geo- logic data to provide a 3-dimensional visualization of geology. Many commerical geographic information systems (GIS) can incorporate digital elevations in their data and display structures. Integrated systems of computer graphics hardware, firmware, and soft- ware provide fast rendering of terrain data for realis- tic images of real world terrain (e.g. Pixar's ChapTer- rains package). Digital elevation data currently are available only for selected portions of the world. For example, there is almost complete coverage for Austria at a 40-m grid and for the U.S. at a 3 arc-see interval, approximately a 30% coverage for the continental U.S. at a 30-m grid, and no published data for Central America or Canada. Much of the 30-m data for the U.S. are within the National Mapping Program category of level I, indicating that only gross errors in data cap- ture have been corrected (Elassal and Caruso, 1983). Digital-terrain data for the U.S. (known as Digital Elevation Model or DEM data) at the 30-m grid scale are produced concurrently with 1:24,000 scale quad- rangle maps, or are produced through automated or manual scanning of aerial photographs. Digital- terrain data data also are obtained through a process which includes the automatic scanning and vector- ization of contour lines, and subsequent editing and interpolation to a grid. The 1:250,000 (3 arc-see) scale digital elevation database was created by the U.S. Geological Survey through this procedure (Elassal and Caruso, 1983). Similar scanning and vectorizing techniques also are used by contractors who provide digital-terrain data. We present a technique for obtaining digital topo- graphy from contoured data which does not require expensive scanning or vectorizing hardware and soft- ware. Although the prototype is developed on a "fast" graphics system linked to a minicomputer, the new generation of personal computers and graphics workstations should be able to support the procedure adequately. Source contour data usually can be obtained from the National Cartographic Information Center, or the equivalent geographical data agency in foreign coun- tries. The data reside on the brown-line topographic separates used in producing topographic map sheets and are provided as mylars or as blue- or black-line prints of the mylars. Copies of the map sheets showing the coordinate grid and map boundaries are required to provide for registration of the brown-line separ- ates. Although the technique presented in this paper can work with color maps, the editing step is much slower than for two-color maps. It is more cost-effec- tive to purchase brown-line separates which contain only topographic data, thus reducing the amount of interactive removal of unwanted lines and features. METHOD The method to obtain digital-terrain data from topographic maps relies on computer graphics hard- I01

Transcript of Conversion of contoured topography to digital-terrain data

Page 1: Conversion of contoured topography to digital-terrain data

Computers & Geosciences Vol. 16, No. I, pp. 101-109, 1990 0098-3004/90 $3.00 + 0.00 Printed in Great Britain Pergamon Press plc

CONVERSION OF CONTOURED TOPOGRAPHY TO DIGITAL-TERRAIN DATA

GREGORY COLE ~, SCOTT MACINNES 2, and JAMES MILLER 3

l Los Alamos National Laboratory, Los Alamos, NM 87545, and University of Arizona, Tucson, AZ 85721, 2Zonge Engineering and Research Organization, Tucson, AZ 85716, and 3 University of

New Mexico, Albuquerque, NM 87131, U.S.A.

(Received 23 November 1988; revised 25 January 1989; received for publication 21 June 1989)

Abstract--High-performance graphics systems coupled with video digitizers provide the capability to obtain digital topography from contour maps. A technique is presented for conversion of contoured data to gridded data. This technique provides a cost-efficient option for obtaining digital topography where such data are not available, for obtaining average elevation data in support of gravity surveys, or for gridding hand-contoured data. The method is interactive, makes use of standard image processing and computer graphics techniques, and requires a user-operator who can read topographic maps. The resultant digital data retain the smooth trends of the contour data and are well within the error limits reflected in the placement of the original contour lines.

Key Words: Image analysis, Computer graphics, Digital elevation.

INTRODUCTION

Digital topography plays an increasing role in the visualization of geologic data, and in the modeling of geologic processes. The production and sale of digital elevation (digital terrain) data by the U.S. Geological Survey as part of the National Mapping Program has promoted the use of this type of data in many geol- ogical applications. Uses of this information include its merging with LANDSAT satellite-acquired digital data to provide oblique views of topographic and land-use features, and its merging with rasterized geo- logic data to provide a 3-dimensional visualization of geology. Many commerical geographic information systems (GIS) can incorporate digital elevations in their data and display structures. Integrated systems of computer graphics hardware, firmware, and soft- ware provide fast rendering of terrain data for realis- tic images of real world terrain (e.g. Pixar's ChapTer- rains package).

Digital elevation data currently are available only for selected portions of the world. For example, there is almost complete coverage for Austria at a 40-m grid and for the U.S. at a 3 arc-see interval, approximately a 30% coverage for the continental U.S. at a 30-m grid, and no published data for Central America or Canada. Much of the 30-m data for the U.S. are within the National Mapping Program category of level I, indicating that only gross errors in data cap- ture have been corrected (Elassal and Caruso, 1983).

Digital-terrain data for the U.S. (known as Digital Elevation Model or DEM data) at the 30-m grid scale are produced concurrently with 1:24,000 scale quad- rangle maps, or are produced through automated or manual scanning of aerial photographs. Digital- terrain data data also are obtained through a process

which includes the automatic scanning and vector- ization of contour lines, and subsequent editing and interpolation to a grid. The 1:250,000 (3 arc-see) scale digital elevation database was created by the U.S. Geological Survey through this procedure (Elassal and Caruso, 1983). Similar scanning and vectorizing techniques also are used by contractors who provide digital-terrain data.

We present a technique for obtaining digital topo- graphy from contoured data which does not require expensive scanning or vectorizing hardware and soft- ware. Although the prototype is developed on a "fast" graphics system linked to a minicomputer, the new generation of personal computers and graphics workstations should be able to support the procedure adequately.

Source contour data usually can be obtained from the National Cartographic Information Center, or the equivalent geographical data agency in foreign coun- tries. The data reside on the brown-line topographic separates used in producing topographic map sheets and are provided as mylars or as blue- or black-line prints of the mylars. Copies of the map sheets showing the coordinate grid and map boundaries are required to provide for registration of the brown-line separ- ates. Although the technique presented in this paper can work with color maps, the editing step is much slower than for two-color maps. It is more cost-effec- tive to purchase brown-line separates which contain only topographic data, thus reducing the amount of interactive removal of unwanted lines and features.

METHOD

The method to obtain digital-terrain data from topographic maps relies on computer graphics hard-

I01

Page 2: Conversion of contoured topography to digital-terrain data

102 G. COLE, S. MACI.~YES, and J. MILLER

ware and software, as well as a user-operator who can read topographic maps. An outline of the method is as follows:

- -A portion of the map is captured by a frame grabber or video digitizer and placed on the graphics screen. A virtual image of this in- formation is created in the memory of the host computer.

--This virtual contour image is edited through user interaction, and elevation values are ob- tained through interpolation for picture elem- ents or pixels located between contours.

- -The interpolated image is overlaid with a grid to obtain spot or average elevations, and these are merged with the database for the map, which has a DEM-style format.

The path of the information flow is shown sche- matically in Figure I. The optimal implementation of the technique is dependent on available hardware. Typical contraints for any high-speed graphics oper- ation are the amount of functionality and memory locally available at the graphics display and the communication speed to a larger memory and more- powerful CPU (Central Processing Unit) of a host computer. With the vector graphics hardware that we have, it is faster to do the bulk of the image processing on the host computer, and to use the graphics workstation as a user interface and a feedback device only.

HARDWARE

It is critical to obtain a clear image of the con- toured data. The quality of the original print or mylar affects the speed with which images can be edited and converted to digital-topographic data, and manual

"cleaning" of the original may be justified. The origi- nal map must be mounted on a flat surface and well illuminated. A map holder with glass cover helps to prevent distortion because of curvature, and to prevent doubling of lines because of reflection from the surface behind the map.

Typical computer hardware that is required to convert contoured data to gridded data includes a video-capture device, a graphics terminal with local input devices, and a CPU with a storage device. The hardware setup of the prototype system is presented as an example of a "high-performance'" system, al- though numerous other configurations would provide equivalent performance.

We capture an image of contoured data through a video camera and frame grabber. The camera is a Sony model DXC-M3A, capable of producing 8 bits (256 levels) each of red, green, and blue signal. The signal is passed through a camera control unit which performs functions such as color balancing or filtering and the user/operator performs the necessary adjust- ments to obtain a "'crisp" image. The frame grabber is an integral part of our graphics terminal and cap- tures an image of 640 x 480 pixels directly into the graphics display. For this presentation, pixels refer to the original 640 x 480 cells of the captured image, and not the resolution of the graphics display. Typi- cally, we capture a 3-1/2 × 2-1/2in. portion of the contour map, so we work with an effective resolution of about 200 lines per inch.

The graphics terminal is a Chromatics CXI536. This "smart" terminal has firmware which is based on the Graphical Kernel System (GKS), the 2-dimen- sional graphics standard. Firmware is machine- encoded software which drastically speeds up perfor- mance. This terminal has a 4mbyte memory for

/ ' J ' /

CONTOUR "L ~ =' l~'~ ' MAP FRAME

GRABBER

,i USER INPUT

DIRECT MEMORY I ACCESS I J r----

SER I N P . ~

I " I ~ U P D A T E

BACKUP/RESTORE

CPU VIRTUAL

IMAGE PROCESSING

r I I IMAGE I I

L.aRIO VALUES!

GKS WORKSTATION(S) Figure 1. Path of information flow. Image of contour map is transferred to memory in CPU, and also displayed at graphics workstation. User interaction modifies virtual image in CPU and updated images are

displayed for user. Products of processing are sent to or restored from disk storage.

Page 3: Conversion of contoured topography to digital-terrain data

Converting contoured topography to digital-terrain data

graphical segment storage. The high-resolution screen has 2 million addressable pixels, which allows con- siderable "zoom" or enlargement of the captured image. The display has 24 graphical planes which allows representation of 16.7 million colors (and dis- crete elevation values), 8 graphic overlay planes which are double-buffered, and a text plane. Devices such as a mouse, switchbox, and valuator dials assist the user in interacting with the graphics image.

The Chromatics terminal is linked to a VAX 8650 computer. Although the terminal has direct memory access (DMA) to the VAX, communication between the VAX and the terminal is one of the most limiting factors for the speed with which an image can be edited and converted to digital data. Porting of this technique to a dedicated graphics workstation, such as a SUN which has an internal CPU and disk space, could reduce the communications bottleneck, but would slow down the graphics generation.

SOFTWARE

The software is written in FORTRAN 77 and uses GKS (Level 2C) commands. The set of 24 graphics planes and the overlay planes arc each considered as separate workstations (in the GKS sense). Menus are created from ASCII text files so that wc can make foreign language versions of the program through translation of the menu files. User response is elicited through a series of pop-up menus, created as segments in the graphics overlay workstation and made visible when needed. The current position of the mcnu cursor and the selected menu selection are highlighted. Double buffering of the overlay planes helps prevent flicker during user input. The text overlay plane provides for standard FORTRAN I/O and is used for lengthy user input, rather than the GKS message facilities, so that the graphics image does not need to be drawn again. The steps of the software procedure (also the choices listed in the main program menu) are described separately.

Setup The setup step includes all of the tasks required to

define the attributes of the database or map. For example, the grid spacing of the database, and the contour interval of the source maps may be specified at this time. Capturing and registering of images which will contribute ultimately gridded information to the database also occur in the setup step. Images are registered to the database through an affine trans- formation (see Loudon, Wheeler, and Andrew, 1980), which removes geometric distortion due to non- parallelism between the camera lens and the map surface. Distortion which is the result of the convexity of the camera lens seems to be minimal. With our current camera setup, and image registration on the outside corners of the capture area, maximum geo- metric distortion exhibited within the interior of the screen image is < 0.4%. As all information except

103

Figure 2. Contour line with thickness of one pixel. Pixel within line (shown by the "X") has two neighbors within

surrounding set of eight cells.

for contour lines must be removed before the gridding step, elevation control points are identified through user-input, and stored in a separate graphic segment that then is made invisible. This segment is made visible later when values are assigned to contours in the GRID portion of the procedure.

Edit The task of the editing step is to convert the data

of the captured image to a set ofcontour lines exactly one pixel thick, removing any other information on the image. Pixels forming the lines will have exactly

two neighboring (and nonadjacent) line pixels within the surrounding set of eight pixels or cells, as illus- trated in Figure 2. Numerous edit tools are required to complete this task, some of which are shown in Table I. Each tool is a separate module and new tools can be developed as required. Editing can bc done on the full image, or a zoomed portion of the image.

Table 1. Main edit menu showing user options

EDIT MENU

CONVOLUTION

THRESHOLD

THIN

PRUNE

ERASE

DRAW

ZOOM IN

ZOOM OUT

AUTO ENHANCE

UNDO

SAVE

HIDE

* RETURN

sharpen image

remove background

make 1 I~xel thick

remove short l ines

er-¢~ I~ncs

draw lines

enlarge subregion

return to original size

automatic edit

w~:lO last edit action

backup cu r'rcnl image

marc menu invisible

return to main menu

Page 4: Conversion of contoured topography to digital-terrain data

[~i4 G. COLE, g. N.IACI>;';ES. and J. MILLER

Conxolution is a classic image processing tech- nique that may be used to highlight image features tsce Dawson. 19S7t. It is used here to enhance the difl~'rence bet~een contour lines and background. The corn olution algorithm adjusts the ~,aluc o fa pixel through an analysis of the values of the neighboring pixeIs. Dynamic update of the image is not required as the procedure is done on the ,.irtual image residing in the host CPU ~here large amounts of memory are ax ailable. The entire image is adjusted based on origi- nal ~alues. and then the original image is replaced with an adjusted in:age.

Thrcsholding is used to remove the background color of the original image and any unwanted artifacts captured b~ the combination of lighting and camera. Any pixcl ~ith a lightness above a certain level is set to the background or no-color value. Histograms proxide statistics on the distribution of color intensity x,,ithin the image and the user can try different levels to remove the unwanted backgrotmd values (shown in Fig. 31. Dillercnt threshold levels can be applied in different sections o1" the image. With poor lighting or faint map original'< optimal thresholding usuall,v in- ,, olxcs a balance between preserving unwanted patch- cs of in:tl~ h:tckgrotmd, and creating breaks in the tt~pogr::phic lines.

Line thinning is done with an algorithm outlined b,, Pavlidis {I 9S2), with a modilication that forces line

pixels to have no more than t~o neighbors. This t~vo-neighbor requirement allows lines to be followed rapidly during the tagging procedure of the interpol- ation step. The line thinning process can leave short branches that are removed by the pruning tool.

The most time-consuming part of editing is the freehand removal and additions of lines. Besides the breaks in the contour lines, there :ire labels which need to be removed, and lines that are touching. Tools have been developed which erase at the cursor loca- tion, or which follow and remove a line at the cursor location. The former is used on the lines that are touching, whereas the latter is used to remove the labels. Dra',ving can be accomplished by tracking the cursor, connecting points identified by the cursor, or searching for and connecting nearby endpoints.

Where there are closely spaced contours, it is not necessary to connect all the breaks in the contour lines. Although the contour tagging routine will not jump across breaks, less effort is required to tag the contours on either side of the break than to freehand the individual, closely spaced, contour lines ~ith a mouse or other tracking device. Interpolating across the break in the contour lines is accurate sulticiently, unless the spacing between the deleted lines is highly ~ariable.

Figure 4 schematically illustrates application of the more-frequentl 5 used edit tools.

Figure 3. Image of contour map and histogram of gra.v-level distribution v,ithin image. Pixels with gray '.alucs to right of ,,ertical line on histogram will be set to background color v:,lue. User can evaluate

mtcractively modilication of image which results from different threshold levels.

Page 5: Conversion of contoured topography to digital-terrain data

Converting contoured topography to digital-terrain data 105

] I J pr :-I" !

i.. z*-~¢" 5 6 4 2 3 2 1 1

~i,~i~i 573 1 2 4 1 1 1 9iil i_27 4 22 ~ h~ ~ ~r~8 1 .,i i i6:5 3 3 ) )!715 3 4

9 6 3 4 i i i 7 5 4 3

4 6 3 5 4 ~)a! ! 43 Y]~I I 4 41714) 4 8

E6i7i3 , 6 9 5 2 6 6 4 1 4 6 ! 8 3

) 3[55L 4 4 5 5 6 5 2

1 1 1 6 5 5 6 4 2 3 2 1 1 ) 119!9 991 29 3 ' ; I [94 6 9 6 9 6 9 i i7 .9 9 9 5 191 99 93) [8[ 9 9 9 9 [4 : 9 9 9 9 4 1

6 9 9 9 9 9 3 9 9 8 9 9 9 9 9 9

! 3 9 9 4 , ,591 ~ 4 8

9 ! 9 9 5

5 5 4 4 5 5 6 5 2

6 5 : 5 6 4 I 9 9 9 9 9i

' 49 ' 6 9,6 9 6 9 [ 7 9 9 9 5 9 9 9 : 9 6 9 9 i 9 9 4 9 9 9j , , 4 6 9 9 9 9J 9 9 9 9 8 9 5 9 9 9 9

9 9 4 5 i97 : 4 8

[ 9 9 j 9 9 5 9i9 9~19

(E) i 9 5 1 5 4 4 5 5 6

119 9 ! 9 9 9 i

: : 9 i 9 9 19 9 i9

!9 19 9. J9~ !9 9 9

9 9 ! 9 9 9 9 :9. ,

, ,9 9 9 . J 9 , , 9 9

9 9 9 9

[(E) 9 9 9 9 9 9 9

9

9 9 ;

9

'(F )

lmiml innmB liIHNi

9 9

9

lmmmmmm immnium[ immmmmm[ l~Bnmmmm

I I I i l i l 9 9]9]9191919j91

9 9 9 9

9 9 _9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 : < 9

9 9

9 9 9

9 9 ( ( ) 9 9 9 9 9 9 9

Figure 4. Schematic illustration of various editing processes. Cells represent image pixels. Numbers within cells represent gray levels with 0 or "unspecified" indicating white or background, and 9 indicating black or definite line position. A, Portion of contour map; B, captured image of contour map. Low gray values in upper right corner are artifact or poor lighting or dirt spot on the map; C, after convolution; D, after thresholding. Threshold level is 3.5; E, after thinning. Pixels are now black or white; F, after pruning. Short branches and short lines have been removed; G, after erasing and drawing. Positions of control points for

line additions are shown by "X"s.

Grid The purpose of the gridding step is to obtain grid-

ded elevation values from the image of one-pixel thick contour lines. The task is accomplished through a sequence of actions. First, contour lines are tagged

with elevation values. Additional elevations are ass- igned to image pixels along control lines. Pixels bet- ween contours or control lines then are assigned el- evations through an interpolation method. Finally, a grid is overlaid on the image and spot or average

Page 6: Conversion of contoured topography to digital-terrain data

106 G . CO L E , S . M A C I N N E S , a n d J . M I L L E R

Table 2. Main grid menu showing user options

GRID ,',RF_2,;L'

RECALL recall elevaUons tagged dunng SETUP

TAG follo,~ contours and set to elevation

HIGHLIGHT highlight pixels with zero slopes indicated by splJnmg

UNDO ZEROS remove highlight

ADD CONTROL splthe along profile for added elevation conlrol

C.SPLINE cubic spline interpolatim by bisection

LINEAR linear interpolation by bis~cUon

FILL fill gaps in interpolation

GRID gel grid values

UNDO undo last action

SAVE backup curium image

RETURN ~ t u m to main menu

elevations are calculated at the grid points. Gridding procedures are listed in Table 2.

The procedure for the tagging of contours is as

[\-allows: - -The user interactively creates a set of connect-

ed line segments which cross untagged contour lines requiring assignment of elevations. The user identifies each of these line segments as going up or downhill.

- -The elevation of the starting position of the set of line segments is defined explicitly through recalling (making visible) the graphics segment of tagged elevations created during the setup step.

- -The current contour value (value of the next crossing) is set initially to reflect the contour value immediately above or below the start elevation, depending upon whether the first- line segment was specified as going up or downhill. Note: It is not necessary to specify a start elevation, but no elevation assignment or tag- ging will be accomplished until two adjacent, nonequal contour lines are crossed. At this time, the current contour value is defined im- plicitly.

- -The connected line segments are rasterized, and the algorithm sequentially evaluates pixels along the set of line segments, looking for intersections with contour lines. If a pixel is identified as part of an untagged contour line, all pixels along the contour line are tagged with the current contour value, and the current con- tour level is increased or decreased by the con- tour increment, l f a pixel is identified as part of a tagged contour line, then the already as- signed elevation is checked with the current contour level. If the assigned elevation is not

equal to the current contour level, but is equal to the value of the contour line most recently crossed, then a slope break is implied (e.g. a ridge or valley has been crossed). The downhill or uphill specification is automatically chan- ged accordingly.

- -When all pixels within the set of line segments have been evaluated, the user can view a profile of the elevation assignments, can accept the tagging as correct, or can reject the elevation assignments.

The described procedure is repeated until all con- tours have been tagged with elevation values. It is possible to assign contour elevations for the whole image from a single initial elevation, by successively starting each new set of line segments within a region that already has tagged contours.

The tagged contours are used as control points for interpolation of elevations at pixels between contours. At times it is necessary to add additional elevation control points to assist the interpolating routine, esp- ecially over ridges or mountain tops, or in sinks and valleys. It is possible to enter the trace of a line through graphics cursor input, which should cross tagged contours. Interpolated elevation values arc calculated for every pixel contained within this line of profile, through interpohttion of the tagged contour values. Interpolation usually is done by cubic splin- ing, so that the change of slope along the profile is kept constant. The algorithm is from Press and others (1986). Cubic splining allows modeling of ridges and valleys, but can create fictitious contour crossings as shown by the small hump to the right of the valley in the cross section of Figure 5. Such artifacts normally occur at sharp breaks in the topography, where the assumption of a smoothly changing slope is not valid. Use of cubic splines requires careful monitoring by the user, but judicious placement of traces with spline- interpolated elevations assists in the interpolation of elevations for the entire image. Other interpolation techniques also are available for the calculation of control elevations.

Interpolation of pixel elevations can be done by several methods including cubic splining of horizontal scan lines, constrained cubic splining, and linear and cubic spline by bisection. Cubic splining of horizontal scan lines involves placing additional vertically orien- ted control lines at approximate 20-pixel increments. The method is fast but creates artificial bumps for certain sets of data as was illustrated in Figure 5. Constrained splining involves automatically high- lighting zero slopes by preprocessing, and then separately splining the individual segments bordered by zero slopes, utilizing the zero first derivatives as the boundary conditions. Image edge constraints are sim- ilar to the unconstrained situation, with the "'natural" condition of a zero second derivative at the map edge unless the point has been identified as having a zero slope.

The method of interpolation by bisection is illu-

Page 7: Conversion of contoured topography to digital-terrain data

Converting contoured topography to digital-terrain data 107

Elevation Profile - 2 1 0 0 2 1 0 0 - b

J~ 1900- > ( '~

i \

700 700 ~ . ~

Mouse Button L) Mouse Button M) Mouse Button R)

Save elevations of highlighted pixels. Draw cross section of highlighted elevations. Undo elevations of highlighted pixels.

Figure 5. Cubic spline interpolation along series of connected line segments. Crossings of topographic lines provide interpolation control points, some of which are labeled on contour image. These crossings control points are identified by circles in cross section which show result of natural spline. Note that artificial humps are created on either side of incised river channel (just right of central portion of cross section), result of

sharp slope breaks.

strated in Figure 6. The image is interpolated succes- sively in the vertical and horizontal directions, with each set of interpolations bisecting the gap between the previous interpolations. The ordering of inter- polations is shown in Figure 6B. Newly assigned ele- vations along horizontal lines augment the set of control points for the vertical interpolation and vice versa. In Figure 6B, iteration t at row B provides a control point for iteration 2 at column C. Linear interpolation is not performed between control points of the same elevation, for example no interpolation is performed at column A in the 1st iteration because only the value "5" is present. For the cubic spline bisection, interpolated values are ignored for seg- ments that go out-of-bounds between control points. Because elevations are stored as integers, some areas which are surrounded by pixels of the same exact elevation during the bisection remain uncolored, and are filled in by minor post-processing, Linear inter- polation by bisection seems to provide the best results within a reasonable amount of time. Unless there are extreme slope breaks in the topography, interpolation errors should be less than one-quarter of the contour

interval, which is consistent with the accuracy of the contours of the original map. The interpolated eleva- tions should be saved temporarily until gridded eleva- tions are incorporated successfully into the database.

Gridding is accomplished following a successful interpolation of the image. The image is overlain by a grid whose orientation and position are determined by the registration and affine transformations cal- culated during the setup step. The spacing of this grid is specified by the database parameters. Elevations are obtained for each grid point, either through bilinear interpolation to provide a point value, or by calculat- ing the average elevation value for pixels within a cell centered on the grid point.

Save The new set of grid points is merged with the

database after the user has a chance to see how well the new data integrate with the rest of the database. For areas of overlapping data, discrepancies are high- lighted, and tools are provided which help the user decide whether the old or new data are correct, or

Page 8: Conversion of contoured topography to digital-terrain data

t08 G . C O L E , S. MACINNES, and J. MILLER

• J 9 5 1 . ; : 9

• . 9

I | 9

I t ' ' i

i

• i i

I(A) II

i5 I 1 " 5 i 1 lJ 5 I 1 ,

15 ' ' 15 , 5]

5 I 5 5 5 5 i 5 5

• ' 9 9 9 i I I 9' 1

I 9l 1 5 1 8 1 7 6 6 5 4 3 2 1

9 8 1 5 i 1 [ 9 ~ 8 7 1 6 5 4 ! ~ 3 2 , , [ 9 8 71 5 ~ 1 } 9 8 8 7 6 1 5 5 4 1 3 3 2 2 9 8 7 6 5 i4 3 9 8 8 7 6 6 J 5 4 4 5

" 5 5 5 5 I : 5 1 5 5 5 5 5

' 16 6 7 l ! : 7 7 8 8 9 I I : : 7 8 9 t 8 8 9 9 (C) i l ~ g ~

N

F

M

k

gg_g

G H I J C D

:9! " 51 I~ i !g HiN NIN 5 NIN 1Ntli i 9i H i 5 t g C i F F 5 F F F I F !1

[ gMC~dH5 M I¥:M K' gig C H 5 I 9iB BJB B B 5 I =J 5

:5 '5 i 5 5 i i o J ! I D E E 9 i ~ I D 9

L- ~ , 1 K 9 9 ' F ~(): I 9 9 i

INTERATION 3 INTERATION 2 INTERATION 1

I I I I I ~ B H O 8 9 g ~ H I I I I I S U H U H H g H H g l I I I H H U H H H g H H g l l

B ~ B ~ B ~ O 0 0 0 0 0 0 [ I I I I I I I B ~ ~ I I I I I I I I ~ ~ IIIIIIIII~BB~E IIIIIIIII~U~ IIIIIIIII~U~I ~ I I I I I I I B ~ I I

I I I I I I I ~ I I I I

I f l .,' .K s ~ ; ,, ~,5 • - " i ¢ • ' / " , ~ ,*f

r / , r l • -"

i ~ , " i i i, "- " " - " • . , . . . ° , , , ,

' I I, i i

(E~)

i t " , . , - - ° - - / L - - : , , o . , * • , ,

,w

Figure 6. Schematic illustration of linear interpolation by bisection. Numbers indicate relative elevations. Feature is valley bottom. Contour interval is 4. A, Tagged contour lines; B, order of interpolation. Iteration 1 consists of column A (no elevations assigned as only points of same elevation are present) and row B (assigned elevations identified by "B"s). Iteration 2 consists of interpolations along columns C and D, and rows E and F. Iterations continue until spacing of successive rows and columns in 1 unit; C, interpolated elevations for 3 iterations of interpolation by bisection identified in (B); D, interpolated elevations for entire image. Note that interpolation is not accomplished beyond range of data; E, contouring of interpolated elevations. Solid lines are original contours, dashed lines are interpolated contours. Some of waviness of

new contours is result of nearest integer assignment of elevations.

whether to make a smooth transition within the area of overlap through weighted averaging of the values. If overlap problems are due to misregistration of an image, it is possible to restore the temporarily saved image with elevations, reregister the image through the setup step, and regrid the data a second time.

Restore It is possible to save the current image at any time

during the edit or grid steps. It usually is advisable to save the completely edited image, and the image that contains the interpolated elevations. The restore op- tion allows the program user to recover from errors, to make consistency checks between successive ver- sions of the image, or to take a break. Before the user is allowed to exit from the program, it is necessary to

evaluate saving the temporary files that have been created.

The software was developed by the three authors. The code currently is in use at Los Alamos National Laboratory and new software tools are being added as we gain experience with different contour maps. Although the code was written to conform with recog- nized standards whenever possible, certain exceptions were made. For example, graphical input through frame grabbing is not addressed in GKS so our code reflects an extension available within within the Chro- matics package. And we used symbolic names longer six characters for increased clarity, contrary to the ANSI 1977 F O R T R A N standard. Modifications to the code undoubtedly would be required if other hardware configurations or other GKS packages are

Page 9: Conversion of contoured topography to digital-terrain data

Converting contoured topography to digital-terrain data 109

used. The software, including various utility routines/ libraries for the graphical menus, and excluding the GKS software, consists of about 8000 lines of codes and comments.

SUGGESTED APPLICATIONS

A principal application of digital topography is 3-dimensional data vizualization, as described in the Introduction. Other uses of digital topography in- clude identification of drainage basin outlines (Jensen and Stannard, 1988), and modeling of geomorphic processes. A quantitative understanding of the weath- ering and erosion of bedrock materials is critical to the exploration geologist who is trying to identify a primary anomalous source of metals. The secondary dispersion of bedrock material partially is a function of the topography, and is reflected in the stream-sedi- ment geochemistry. Through knowledge of the digital topograpy, it may be possible to determine the expect- ed bedrock contributions to stream-sediment sam- pies, and thus identify anomalous metal concentra- tions.

The technique presented here provides a method to obtain digital topography when no existing resource is available. It also can provide average elevations for terrain corrections in gravity surveys, and can assist in coverting other types of contoured data, such as air- borne E-M, to a gridded format for subsequent inte- grated data analysis.

SUMMARY

A technique has been presented for obtaining di-

gital terrain data from contour maps. The method involves capturing an image of contoured data, edit- ing the image so that only contour lines remain, inter- polating to determine evaluation values for pixels between existing contour lines, determining grid val- ues from the image, and merging these values into the database for the map. The technique can be im- plemented with many combinations of hardware and software, and provides a rapid and inexpensive way of developing a database to assist in the 3-dimensional or modeling of geologic data and processes.

Acknowledgments--This manuscript benefited from sugges- tions and review by Larry Maassen. John Brayer, and an anonymous referee. This research was funded by Los Ala- mos National Laboratory, and was performed partially under the auspices of the U.S. Department of Energy.

REFERENCES

Dawson. B.M., 1987. Introduction to image processing algo- rithms: Byte, v. 12, no, 3, p. 169-186.

Elassal, A.A., and Caruso, V.M., 1983, USGS Digital Carto- graphic Standards: Digital elevation models: U.S. Geol. Survey Circ. 895-B, 40 p.

Jensen, S., and Stannard, L.G., 19S8, Deriving hydrologic response units from digital elevation model data (abst.): Proc. of GIS Symposium: Integrating Technology and Geoscience Applications, Denver, Colorado, p. 141.

Loudon, T.V., Wheeler, J,F., and Andrew, K.P., 1980, Af- fine transformations for digitized spatial data in geology: Computers & Geosciences, v. 6. no. 4, p. 397-412.

Pavlidis, T., 1982, An asynchronous thinning algorithm: Computer Graphics and Image Processing, v. 20, no. 2, p. 133-157.

Press, W.H., Flannery, B.P., Teukolsky, S.A.. and Vettcrl- ing, W.T., 1986, Numerical recipes: Cambridge Univ. Press, Cambridge, 818 p.