A dataset with a set of points has an attribute called HEIGHTS which is filled with numbers like, 10.8, 0.4 and 150.6 etc... I want to transform this dataset to a shapefile. In the transformation I want to add a new column to the shapefile which will need to contain a color code.

How can I map the height values to this color code?

For example all heights between 5-10 should have the color dark blue, all heights between 10 and 20 should have the color light blue etc...... I tried to use the valuemapper transformer, but it only seems to work for 1:1 mappings.

I am using FME 2009. This means that I cannot use the AttributeRangeMapper and AttributerRangeFilter transformers. Can I conclude that what I want is not possible in FME 2009 and I should look at a newer version on FME?

  • 1
    How about using the AttributeRangeFilter? Give each range it's own Output Port. Then use the StringFormatter to replace the numeric values with your color values. – dchaboya Dec 21 '12 at 16:34
  • 2
    Does 2009 have PythonCallers? If so, you could just write a function that runs the value through a set if if statements and set the color code that way. – Chad Cooper Dec 27 '12 at 16:58

FME 2009 supports Tester transformers; you could chain a bunch of those together (one for each range) and tag features that pass accordingly while passing fails onto the next tester for further evalutation.

  • I have tested it and it works. It's not pretty en can make your workspace really large if you have a large number of classes to go through, but it works. Thanks. – Freeze Jan 27 '13 at 14:32

not ideal but as a bit of a fudge you could use an attribute range mapper on the height column - each output then going to a separate attribute creator for the colour column

  • 1
    I am affraid both the attributeRangeFilter and AttributeRangeMapper only exist in FME 2010 and onward and not in FME 2009. Such a shame, because the do seem to give me what I want. – Freeze Dec 27 '12 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.