RangeMapper

From fmepedia

RangeMapper is a Workbench Transformer.


Table of contents



Description

The RangeMapper is similar to the ValueMapper but is used to map ranges of values rather than individual values. This makes it good for classifying data into groups based on attribute values (eg 0-10 = Group1, 10-20 = Group2, 20-30 = Group3, etc)



Example 1

The attached workspace shows an example use of the RangeMapper transformer.


In this example we wish to extract data on Single Family housing from a city zoning dataset, and map the results thematically on the basis of the zone size. To do this we need to divide the data into a series of classes (Very Small, Small, Medium, Large, Very Large) and this is where the RangeMapper comes in.


Workspace Screenshot


Above: The RangeMapper workspace


The steps in this workspace are:


  • Read the source zoning data (from a GML dataset)
  • Use a StringSearcher transformer to identify single Family zones (those starting with SF) and discard anything else
  • Use an AreaCalculator transformer to calculate the area (size) of each zone
  • Use the RangeMapper to map the zone size to a specific class
  • Use a ValueMapper to map the class to a particular fill color and an AttributeCreator to set a constant line color
  • Send the data to the FME Viewer using a Visualizer transformer.

As the workspace annotation says, the colour mapping you would usually do in a GIS application, we just do it here so we can get visual results in the FME Viewer. Also, the Visualizer has a group-by option set, so that each group (class) of features is depicted on a separate layer in the Viewer. If you were writing to a dataset instead you would probably use a Fanout to acheive the same effect.


Output


Above: The attribute output. Querying a feature shows that the _area attribute has been mapped by the RangeMapper to a class called ZoneSize



Above: The output layers. Note how they have taken the name of the assigned class (because the Visualizer grouped features by ZoneSize)



Above: The spatial output. Note how larger areas are a darker colour (because the ValueMapper mapped ZoneSize to color)

Attached Files
filesizedate
RangeMapperExample.png46.5 kB09/04/09
RangeMapperExample.zip2.5 MB09/04/09
RangeMapperExample2.png15.4 kB09/04/09
RangeMapperExample3.png8.7 kB09/04/09
RangeMapperExample4.png23.0 kB09/04/09
User Comments Add a new comment