Skip to main content
Solved

Color gradiation based on Z values

  • March 12, 2022
  • 1 reply
  • 23 views

f.kemminje
Contributor
Forum|alt.badge.img+11

Dear Team,

I really appreciate the data inspector for z visualization of the point cloud, but I can't find how this color grading works inside fme data inspector.In my case I wanted to bring cloud points to the shapefile by color gradation based on z value. so my output shapefile looks the same as fme data inspector view. how can I do this ? is there any tool available for color gradation for feature color (based on z value)

Best answer by takashi

Hi @f.kemminje​ , you can use the RGBGradationCalculator from FME Hub to create gradation color values stored in a list attribute (called _color{} by default), then use the ListExploder to explode the feature into multiple features each of them contains an attribute storing a color value derived from the list. The ListExploder also adds element index (0-based sequential number) to each feature.

Next, for each point, map its z-coordinate to an index (0 to the number of colors - 1) according to your desired rule.

You can then merge a color value corresponding to its z-coordinate with FeatureMerger, using the index as join key.

Note that the Shapefile format doesn't support storing feature color definition. You can just save the color value as a user attribute.

Hope this helps.

View original
Did this help you find an answer to your question?

1 reply

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • March 12, 2022

Hi @f.kemminje​ , you can use the RGBGradationCalculator from FME Hub to create gradation color values stored in a list attribute (called _color{} by default), then use the ListExploder to explode the feature into multiple features each of them contains an attribute storing a color value derived from the list. The ListExploder also adds element index (0-based sequential number) to each feature.

Next, for each point, map its z-coordinate to an index (0 to the number of colors - 1) according to your desired rule.

You can then merge a color value corresponding to its z-coordinate with FeatureMerger, using the index as join key.

Note that the Shapefile format doesn't support storing feature color definition. You can just save the color value as a user attribute.

Hope this helps.


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