Example 1

The 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).

Workspace Screenshot

User-added image

Output Screenshots

User-added image User-added image
Above: an ImageRasterizer transformer was used to convert an Ordnance Survey vector dataset (left) into a GeoTIFF raster dataset (right).

Example 2

This 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:
  • contours
  • elevation points
  • streams
  • lakes
  • tile boundary

Before rasterizing, the following steps are performed:
  • Change existing colors in a certain coding system to more traditional for raster or paper maps
  • Extract contour elevation for separating regular contours (every 10 metres) from index contours (every 50 metres)
  • Extract elevation and then add and stroke labels for elevation points
  • Replace elevation points with small circles for better visibility
  • Split waterbodies into areas and outlines for setting different fill and outline colors
  • Force everything to 2D so fme_color is used during rasterization
  • Buffer and create a donut from the tile boundary to make the boundary thicker
  • Set priority and sort features so contours are on top of hydrography etc
  • Reproject from LL83 to UTM83-12 (just to show that it's also possible)

After that, the result is sent to the ImageRasterizer and then to a raster writer, in our case, GeoTIFF.

User-added image

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.