VectorOnRasterOverlayer Example
From Fmepedia
This example shows contains three workspaces, which add vector layers to a raster. The workspaces and source datasets (CONTOURS.ffs, INDEX_CONTOURS.ffs, and building-footprints.ffs) are attached to this page (see below).
The first workspace (ContoursOnRaster.fmw) 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:
The second workspace (BuildingsOnRaster.fmw) 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:
The third workspace (TwoLayersOnRaster.fmw)combines the two previous workspaces. It has three VectorOnRasterOverlayers with unique parameter combination in each:
If parameters can be the same for all layers (SameParameters.fmw), 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.
