Computer Contouring
Contouring shows the third dimension on sheet of paper or
the computer monitor. Common uses on maps include topographic maps, or weather analyses.
Contours can also appear on cross sections to show sound velocity or density or salinity or temperature versus depth
Contours creates a math model of surface, which can be used for derivatives
(slopes), isopachs, volume calculations, or interpolations
Contouring
 Contouring uses lines to connect all points on a surface
with the same value in the z direction.

isoline = line of equal value

contour = isoline of elevation (but frequently used for any isoline)
 Computer contouring interpolates, generally linearly or biliniearly,
between known data points and then connects these
interpolated points.
 Two different approaches to contouring use Triangulation or
Gridding.
 Grid contouring can introduce a problem "honoring
the data points", since once the grid is created, the original
points are no longer used.
 One set of triangles can be mathematically described as
best for triangulation contouring.
 Contours composed of straight "Unnatural" line segments:
direct result of assumption about slopes
Principles of logical contouring:
for the computer to do contouring, it must have certain rules to
follow.
Computer behaves like "average" person in terms of
where it bends the contours (bunching or spreading)

In some cases with a rectangle, there can be two ways to draw the
contours, as in the case on the left. On the left, a ridge
connects the two points with elevation of 80, and on the right, a valley
connects the two points with elevation 70. The number of such
boxes will generally be small, and with a large DEM, the effect will
also be very small. 
The contouring of a grid can be done in two ways:
 On the fly, on a group of four grid points at a time. This is very
fast; the algorithm just has to determine where the contour lines cross the
fours sides of the rectangle, and then connect them. There can be
ambiguities as shown in the figure above. This does not allow labels
(which will be slow anyway, and might just clutter a screen map). When
blown up, the individual line segments become obvious. In flat
terrain, or with noisy DEMs, the patterns can be chaotic.
 By creating a shapefile with the contour lines. This requires
"threading" the lines though the DEM, to get continous lines These
lines can be smoothed after generation, or the DEM can be smoothed
(filtered) before the contouring. This must be done to label some of
the contours.
Last revision 11/26/2017