VectorOnRasterOverlayer
From fmepedia
VectorOnRasterOverlayer is a Workbench Transformer.
| Table of contents |
Description
This factory takes any number of vector features and overlays them onto a single raster feature. The properties of the output raster are identical to that of the input raster.
Examples
These example are three workspaces, which add vector layers to a raster. The workspaces and attachment 'SourceData.zip|source datasets (CONTOURS.ffs, INDEX_CONTOURS.ffs, and building-footprints.ffs)' not found are attached to this page (see below).
Example 1
The first workspace (attachment 'ContoursOnRaster.fmw' not found) adds two layers of contours - regular and index contours. The workspace simply sets colors for each layer, and the sends all the features to VectorOnRasterOverlayer. Anti-aliasing is set to 'yes' as it seems to be a better option for long, smooth and curvy features such as contours:
image 'ContoursOnRaster.jpg' not found
Example 2
The second workspace (attachment 'BuildingsOnRaster.fmw' not found) splits area features into two layers - areas themselves and area outline - this way we can set separate colors for the boundary and the interior of areas. Besides, anti-aliasing is set not used (set to 'no), and this enables setting tolerance parameter, which controls how many pixels should be rendered depending on their relative position to an overlapping vector feature. Zero tolerance should render less pixels than tolerances 0.5 or 1, what means slightly smaller rasterized feature size. This way we can add area outlines without having fill colors squeezing outside - we set 0 tolerance for areas, and 0.5 for their outlines. For this we need two separate VectorOnRasterOverlayers:
image 'BuildingsOnRaster.jpg' not found
Example 3
The third workspace (attachment 'TwoLayersOnRaster.fmw' not found)combines the two previous workspaces. It has three VectorOnRasterOverlayers with unique parameter combination in each:
image 'TwoLayersOnRaster.jpg' not found
If parameters can be the same for all layers (attachment 'SameParameters.fmw' not found), then there might be a need in sorting features before sending them to the VectorOnRasterOverlayer. Use AttributeCreator for each vector layer, set some numbers, and send all the features to the Sorter transformer. Lower numbers will be rendered first, hence go below the higher numbers.
