Rasterizer

From fmepedia

Rasterizer is a Workbench Transformer.

Table of contents

Description

This transformer converts a set of vector features into a single raster feature/dataset.



Example

The attached workspace shows an example use of the Rasterizer transformer.
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


Output Screenshots


Above: a Rasterizer 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 Rasterizer transformer.

The source DWG file consists of the following layers:

  • contours;
  • elevation points;
  • streams;
  • lakes;
  • tile boundary.

Before rasterizing the following steps are performed:

  • Changing existing colors in a certain coding system to more traditional for raster or paper maps;
  • Extracting contour elevation for separating regular contours (every 10 metres) from index contours (every 50 metres);
  • Extracting elevation and then adding and stroking labels for elevation points;
  • Replacing elevation points with small circles for better visibility;
  • Splitting waterbodies into areas and outlines for setting different fill and outline colors;
  • Forcing everything to 2D so fme_color is used during rasterization;
  • Buffering and creating a donut from tile boundary to make the boundary thicker;
  • Setting priority and sorting features so contours are on top of hydrography etc;
  • Reprojecting from LL83 to UTM83-12 (just to show that it's also possible).

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

In some cases, multiple Rasterizers 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 Rasterizers are used, RasterMosaicker is also required to bring all the rasters into one.

RasterizationOne.fmw shows how to use one rasterizer for multiple layers. It's well commented, use it as a main example. RasterizationMany.fmw shows multiple Rasterizers and RasterMosaicker, which combines all the rasters together.

Attached Files
filesizedate
Rasterizer Example.zip97.5 kB11/28/08
Rasterizer.png117.0 kB11/28/08
Rasterizer.zip4.0 MB11/28/08
Rasterizer3.jpg55.4 kB11/28/08
rasterizer1.jpg32.0 kB11/28/08
rasterizer2.jpg19.4 kB11/28/08
User Comments Add a new comment