Example 1The attached workspace shows an example use of the Rasterizer transformer. The Rasterizer has now been split into two transformers with slightly different functions, ImageRasterizer & NumericRasterizer
NB: For privacy/copyright reasons the source data isn't attached
In this example, an Ordnance Survey NTF vector dataset is turned into a GeoTIFF raster dataset. Available settings are the grid size of the raster and the background colour. In this case the grid is 1000 x 1000 so, for a 1000m square dataset, it gives a 1m resolution. The background colour is a medium grey. The original vector features were assigned a white colour (fme_color=1,1,1).
Above: an ImageRasterizer transformer was used to convert an Ordnance Survey vector dataset (top) into a GeoTIFF raster dataset (bottom).
Example 2This scenario shows how a DWG file with multiple layers can be transformed into a raster with the ImageRasterizer transformer.
The source DWG file consists of the following layers:
Before rasterizing, the following steps are performed:
After that, the result is sent to the ImageRasterizer and then to a raster writer, in our case, GeoTIFF.
In some cases, multiple ImageRasterizers may be used if different rasterization parameters are required. For example, antialiacing is good for contours, but not very good for rectangular tile boundaries - it's the case where we should use two rasterizers for a contour file with a frame. When more than one ImageRasterizer is used, a RasterMosaicker is also required to bring all the rasters into one.
RasterizationOne.fmwt shows how to use one ImageRasterizer for multiple layers. It's well commented, use it as a main example. RasterizationMany.fmwt shows multiple ImageRasterizers and RasterMosaicker, which combines all the rasters together.