Skip to main content
Solved

Color gradiation based on Z values

  • March 12, 2022
  • 1 reply
  • 35 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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • 7842 replies
  • 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.