The Trace template appears in the template list when a raster tile field, of type Tile, has been picked in the Transform pane. Using values in the raster image, the template creates a drawing with vector areas covering regions of similarly-colored, that is, similarly-valued, pixels.
Using values in a raster image, create a drawing with vector areas covering regions of similarly-colored, that is, similarly-valued, pixels. Each area will also have a Value attribute field giving the pixel value for which it was created. The template can create areas whether values for pixels are intended as colors or as elevation or other values.
The Similarity factor gives the range within which pixel values will be considered to be in the same classification. A Similarity of 10 would group values of 11, 14, and 18 together in one group and values of 20, 23 and 27 in a different group. The default value of 1 for Similarity means to treat pixels within the same integer values as unique. A value of 0 for Similarity would treat each unique pixel value found as a separate classification (using 0 is often a mistake given there might not be an intended difference between close pixel values such as 1.00003 and 1.000031).
The Split into shapes option, when checked (default), will automatically split all areas for the same class of color into separate area objects. Unchecking this option will result in the creation of a single, multibranched area object for each class. This makes for a simpler results table and the ease of selecting all like areas with a single Ctrl-click, but when starting with larger raster data it can result in very large areas, consisting of millions of coordinates to cover all of the branches.
Launch the template by choosing a Tile field and then double-clicking the Trace template. When the template launches we can specify options.
We start with a raster image where a single number for each pixel, that is, a single channel, indicates a land use code for that pixel.
The image above is Styled with a palette, the Land Cover palette in the Classic collection. For example, it uses green colors for pixels where the classification code is intended to mean forest. The standard palette has been modified to use shades of blue for pixel values 53 and 76, which values are used in the image's data set for regions covered by water. The image is created from a tile field in the table called Tile. Approximately 30 different colors are used, to represent 30 different land uses in the region.
With the focus on the Land use raster image, in the Transform pane we choose Land use raster as the subject layer and Tile as the field to use.
We double-click the Trace template to launch it in the Transform pane.
In the Trace template, we enter 1 for Similarity, since we want each area to be created only for a single, integer value in pixels. We check the Split into shapes option so that non-contiguous regions that have the same value for their pixels will result in separate area objects.
The only allowed Result destination is New Table, since a new drawing must be created from the raster image. For the name of the new drawing we enter Trace areas, using an analogous name for the new table. We could use whatever names we like, but it is wise to specify names that remind us what the new components contain.
A new drawing and table called Trace areas appear in the Project pane. We drag and drop the Trace areas drawing into the Land use raster window as a layer.
In the illustration above we have colored the Trace areas drawing with Style using a thematic format based on the Value attribute field in the drawing. We have used the same Land Cover palette as used in the raster, with unique values for the intervals.
Comparing the Trace areas drawing to the original Land use raster image, the drawing contains area objects that exactly overlay regions of same-valued pixels.
Trace and Heights
The Trace template can be used with data sets that show terrain elevations to create results similar to using the Contour template.
Consider the elevation data set used in examples, as seen above.
With the focus on the Land use raster image, in the Transform pane we choose Elevation Raster as the subject layer and Tile as the field to use.
In the Trace template, we enter 1 for Similarity. That will create an area for each region of pixels that has a different integer bounded value.
We check the Split into shapes option so that non-contiguous regions that have the same value for their pixels will result in separate area objects.
For the name of the New Drawing we enter Trace elevation areas 1, using an analogous name for the new table. We could use whatever names we like, but it is wise to specify names that remind us what the new components contain.
A new drawing and table called Trace elevation areas 1 appear in the Project pane. We drag and drop the Trace elevation areas 1 drawing into the Elevation Raster window as a layer.
We can see that using a Similarity of 1 has created so many areas that are so densely packed the resulting drawing is a mass of black color.
We will re-run the transform using a Similarity of 10.
In the Trace template, we enter 10 for Similarity. That will create an area that covers each swath of pixels within a range of 10, that is, heights from 0 to 10, 10 to 20, and so on.
For the name of the New Drawing we enter Trace elevation areas 10, using an analogous name for the new table. The 10 in the name reminds us this new drawing was created using a similarity of 10.
A new drawing and table called Trace elevation areas 10 appear in the Project pane. We drag and drop the Trace elevation areas 10 drawing into the Elevation Raster window as a layer.
Using 10 for Similarity results in a more useful set of areas.
Styling the drawing we can see the effect is similar to creating contour areas. We have colored areas using unique values for intervals and the CB Spectral palette in reverse order.
Sample image - Many illustrations for transforms for raster images use an Elevation Raster sample image, a version of the formatted example of importing an SDTS format DEM from the Example: Import DDF SDTS DEM Raster File topic. The example project may be downloaded from the Downloads page on the Manifold web site.
Transform - Tiles