Style: Contouring using Colors

We can use raster elevation data to create raster contours by coloring pixels by altitude.    Contouring is often done by creating vector drawings from raster images, using the  Transform - Tiles: Contour template for Tile fields in raster images,  but we can also create useful contour displays in raster images by coloring pixels using thematic formatting.


For a different approach that produces the same visual effect as shown in part of this topic, see the Example: TileMaskRange Expressions  topic.


This topic uses the data set imported and initially styled in the Example: Import DDF SDTS DEM Raster File  topic.



Consider the Style settings above, where we have specified palette intervals that are 100 feet apart, using closest lower value for Fill.  The StylePixel property value for the palette is:


{ "Channel": 0, "Fill": "boundmin", "Shade": "compatible", "ShadeScaleZ": 0.1, "ShadeSun": 315, "StyleShadeSunAltitude": 45, "Value": 12211667, "Values": { "100": 12211667, "200": 4286945, "300": 49151, "400": 3329330, "500": 16776960, "600": 16685824, "700": 16711680 } }


We can copy and paste the above into the StylePixel property of the image to specify the same palette, with no need to manually enter intervals and colors.



The result, seen above with shading turned on, provides contours for the elevation data where each elevation interval is rendered in a different color.   This is different than creating contour areas or lines in a drawing using the  Transform - Tiles: Contour template, as shown in the Example: Contour Areas and Contour Lines  topic.



We can apply transparent color to leave only a single contour interval visible in such an image.  For example, in the above we have changed intervals so the interval from 250 to 300 feet is colored in magenta, and all other pixels use transparent color.



The result is seen above, with shading turned off, and seen with 50% opacity in the Layers pane, using a Bing streets image server layer as a background.  It  shows all locations in the area of interest with a terrain elevation between 250 and 300 feet.



Turning on the satellite layer and turning hill shading back on, we can see the 3D effect of combining the hill shaded contour swath with photographic satellite imagery.


See Also



Images and Channels


Palette Images




Style: Drawings


Style: Images


Style: Labels


Style: Channels and Outputs Tutorial


Style: Autocontrast


Style: Invisible Pixels


Style: Hill Shading


Style: Resample


Style: Palettes


Example: TileMaskRange Expressions


Example: Create Two Images From One Table - More than one image can show data from the same table, including from the same tile field.


Example: Change the Contrast of an Image - In this example we use the Style pane to change the contrast of an image.


Example: Using the Assign Channels Button - The Assign Channels button in the Style pane for images allows us to assign channels to the standard three Red, Green, and Blue display outputs using frequently-desired arrangements.   The button provides a short cut way to assign all channels at once instead of doing each channel individually.


Example: Assign Channels - How to use the Style pane for images to assign channels to display outputs such as R, G, B or A.  This topic shows examples of channel combinations and the visual results.


Example: Set Image Transparency using Alpha - The A row in the Style pane allows us to specify what transparency we want to apply to the image, either by applying the same value for A for all pixels or by using one of the other channels to also control the A value.


Example: Autocontrast and Hill Shading Images using Style - This example shows how the Style pane can hill shade an image using the values of pixels as heights and generating shadows as if the Sun were located at the specified azimuth and altitude.   This capability is used most frequently with raster images to give an impression of three dimensionality in cases where the values of pixels represent terrain elevations.


Example: Style Applied to an Image Server Image - Because the Style pane simply changes the way an image is displayed and not the data, it can operate on read-only data served by various web servers such as WMS REST servers.    In this example we look at every detail of creating a data source using an image server and then manipulating the appearance of the display with Style.  We will connect to a WMS server that provides LiDAR data in various forms, including as terrain elevation.


Example: Import CTG Grid Cell File and Style - A companion topic to the Example: Import GIRAS vector LULC File and Style topic.  We import a CTG LULC Grid Cell file containing raster data showing land use and land cover and then we use Style to provide a more understandable display.


Example: Import DDF SDTS DEM Raster File -  We import a raster data terrain elevation surface from USGS SDTS format using DDF files.


Example: Import GIRAS vector LULC File and Style - A companion topic to the Example: Import CTG Grid Cell File and Style topic.   We import a USGS land use file in GIRAS vector format and then we use Style to provide a more understandable display.