Solved

Color gradiation based on Z values

  • 12 March 2022
  • 1 reply
  • 3 views

Badge +3

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)

icon

Best answer by takashi 12 March 2022, 17:23

View original

1 reply

Userlevel 2
Badge +17

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.

Reply