Example: Contour Areas and Contour Lines

In this example we use the Contour Areas transform template in the Transform panel for images to create a drawing with vector areas showing height contours at desired altitude steps.   We color the areas using the attribute fields automatically created by the template.  Next, we apply a similar procedure using the Contour Lines transform template to create a drawing with vector lines showing height contours at the desired intervals.

Contour Areas

il_trans_img_contour_areas01.png

 

We start with a raster image that was imported from an ASTER terrain elevation data set showing heights of terrain near Mount Hood, a volcano in Oregon in the United States which last erupted in 1782.   A single number for each pixel, that is, a single channel, specifies the height at that pixel.  The terrain elevation may be visualized by  using the height values as either grayscale color values or an index into a palette.

 

il_trans_img_contour_areas_dlg01.png

 

We can use the Style panel to see both the current coloring of the image as well as the lowest and highest elevations.  Comparing the numbers to what we know of the heights of mighty stratovolcanoes in the American Northwest, we can see the data set gives heights in meters.

 

We launch the Transform panel for images and choose the Contour Areas transform, choosing the Tile field.

 

il_trans_img_contour_areas_dlg02.png

 

Based on the numbers we saw in the Style panel, we use a Min Height of 0 and a Max Height of 3300 with a Step of 300.  We leave the default Decompose to shapes option checked, which creates independent area objects in all regions for similar contour values.   Unchecking this box creates a single, multibranched area object for each contour interval.

 

il_trans_img_contour_areas02.png

 

The preview shows the area objects that will be created in the new drawing.  Press Add Component to create the new drawing.

 

il_trans_img_contour_areas03.png

Dragging and dropping the new drawing into the map, we can color it using Style to show the areas it contains.

 

il_trans_img_contour_areas_dlg03.png

 

The style uses the same thematic format based on the ValueMax attribute for both the fill color for the body of the area as well as a slightly darker tone for the area boundary line.   We use the ColorBrewer CB Spectral palette, with reverse ordering of colors.

 

Contour Lines

il_trans_img_contour_lines01.png

 

We start with a raster image that was imported from an ASTER terrain elevation data set showing heights of terrain near Mount Hood, a volcano in Oregon in the United States which last erupted in 1782.   A single number for each pixel, that is, a single channel, specifies the height at that pixel.  The terrain elevation may be visualized by  using the height values as either grayscale color values or an index into a palette.

 

We can use the Style panel, as shown in the Contour Areas template above,  to see both the current coloring of the image as well as the lowest and highest elevations.  

 

il_trans_img_contour_lines_dlg01.png

 

Preview: We apply Contour Lines to Tile.  Based on the numbers we saw in the Style panel, we use a Min Height of 0 and a Max Height of 3300 with a Step of 300.  We leave the default Decompose to shapes option checked, which creates independent line objects for all similar contour values.   Unchecking this box creates a single, multibranched line object at each contour value.   Leaving the default Decompose to shapes option checked also has the advantage that if any of the created lines exceeds 64 million coordinates (! ... a big line...), Manifold will automatically split it into more than one line so that each stays less than 64 million coordinates in size.

 

il_trans_img_contour_lines02.png

 

The preview shows the line objects that will be created in the new drawing.  Press Add Component to create the new drawing.

 

il_trans_img_contour_lines03.png

Dragging and dropping the new drawing into the map, we can color it using Style to show the lines it contains.  

 

il_trans_img_contour_lines03a.png

 

We use a thematic format for the lines similar to the thematic format shown in the Contour Areas template above, again using the CB Spectral palette in reversed order.

 

Contours provide comprehensible displays when we use them with restraint.   Too many contour lines at too small a step can decrease understanding.

 

il_trans_img_contour_lines04.png

 

We zoom further into the example data set.   The bright region is the summit of Mount Hood.

 

il_trans_img_contour_lines_dlg02.png

 

In the Transform panel we choose Contour Lines again, but this time we use a Step of 100.   That creates three times as many contour lines as using a Step of 300.

 

il_trans_img_contour_lines05.png

 

The system shows a preview of the contour lines that will be created.  We press Add Component.

 

il_trans_img_contour_lines06.png

 

Dragging and dropping the newly-created drawing into the map, we can thematically format it using the Value attribute.

 

Suppose we would like to create contours on custom intervals, that is, not on intervals with an even step between each interval?  That is very easy to do, and illustrated step-by-step in the SQL Example: Custom Contour Intervals topic.

 

Videos

Trace Vector Areas from Raster Pixels

 

Five Minutes for Contours

 

Contour a 300MB DEM in Five Seconds

 

See Also

Style

 

Contents Pane

 

Contents - Transform

 

Transform Templates - Images

 

Example: Tanaka Contours - Also known as illuminated contours, Tanaka contours give the appearance of three dimensionality to contour lines by brightening lines on a slope facing a presumed light source while darkening lines on a slope facing away from the light source.  Lines are also made wider when perpendicular to the light source.  This topic shows how to create the Tanaka effect in contour lines.

 

SQL Example: Custom Contour Intervals - This example builds on the Example: Contour Areas and Contour Lines topic, using the Edit Query button in the Transform panel for images to learn how to slightly alter the generated SQL to create contour areas or lines on whatever intervals we like, and not just evenly spaced intervals like the default transform creates.   It's incredibly easy.

 

Example: Trace Vector Areas from Raster Pixels - This example follows the Trace Vector Areas from Raster Pixels video on the Gallery page.   We use the Trace Areas template in the Transform panel for images to create a drawing with vector areas covering regions of similarly-colored pixels.  Next, we use a simple query to add classification codes from a USGS table of classes to the resulting drawing, using a simple INNER JOIN SQL statement.