Skip to main content
Question

Applying a colour scale to features based on attributes

  • October 15, 2018
  • 2 replies
  • 294 views

Forum|alt.badge.img

Hi,

I'm looking to produce a map which visualizes polygons based on an attribute value (e.g, population) and scales them high to low or low to high. Using FeatureColorSetter i can apply a random colour to each area based on an attribute, but i would like to apply a colour scale. For example, going from a dark red (highest population) to light green (lowest population). Is this something that can be done, without having to use a styling transformer for each different attribute?

Thanks

2 replies

takashi
Influencer
  • October 15, 2018

Hi @johnwk, possibly the RGBGradationCalculator from FME Hub could help you. This custom transformer generates a list attribute which stores color values based on specified two or more seed color values and number of colors. You can explode the list with the ListExploder and then merge an appropriate color value to each polygon using the list index (= rank of population) as Join On parameter.

Demo: rgb-gradation-calculator-example.fmwt (FME 2018.1.0.3)


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • October 15, 2018

one of many variants, you can find many creative ways to do it.

(this is actualy one line, I split it to keep it readable)

Get min/max using a statisticscalculator.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings