Skip to main content
Question

Setting the color of lines and points using an attribute value as input for color to KMLStyler

  • June 18, 2019
  • 4 replies
  • 506 views

pcgveenstra
Contributor
Forum|alt.badge.img+5

I have a set of polyline features and a set of point features in a ShapeFile. Each set of features has a RID field. The RID for a polyline record corresponds to an RID field for the points. As expected, one line has many points that comprise it. There are 10-20 lines in the input dataset and ~1500 points. I just want to show each unique RID value as a different color in my output KML file. The workbench goes something like this:

1) Read the Lines and the Points

2) Read a SQLite DB containing a table listing a RID, and a Color (both RGB 100,100,100 and KMLColor FF00987F format (http://www.zonums.com/gmaps/kml_color/)

3) FEature Merger moves the attributes from the SQL Lite DB to the Shapefiles, the reprojector, 3dforcer, KMLPropertySetter then the KMLStyler where the colors for all symbology is set using the fields containing the colors merged from the SQL lite databases.

4) The resulting data is written out to the KMZ.

The issue is that neither the RGB or the KML Color values are applied to the outgoing features. One or two of the lines show up in RED, the remainder show up as plain black lines. I want features with RID=1 to be red, RID=2 to be yellow, etc.

I'm using FME 2019.0.2.0 - 20190605 Build 19260 MacOX, 64=bit.

Thanks,

@pcgveenstra

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.

4 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • June 18, 2019

I think the attribute you reference in the kml styler needs to be the fme colour, so red would be 1,0,0 yellow 1,1,0 etc.


arnold_bijlsma
Enthusiast
Forum|alt.badge.img+15
  • Enthusiast
  • 126 replies
  • June 19, 2019

I think @egomm might be on the money!

But before I'd read her answer, I thought it may have something to do with having to create aggregates of your point geometries onto their parent line geometries, as explained in this tutorial: https://knowledge.safe.com/articles/898/how-do-i-label-google-earth-polygons.html


pcgveenstra
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 5 replies
  • June 19, 2019

The suggestion of using FME Colors ranging from 0-1 for each RGB element (0.5,0.5,1) worked like a charm. Thanks @egomm.


pcgveenstra
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • 5 replies
  • June 19, 2019

The suggestion of using FME Colors ranging from 0-1 for each RGB element (0.5,0.5,1) worked like a charm. Thanks @egomm.

 

One thing to remember - since this is trying to export a 'unique' color for each unique polyline and associated points - make sure the "Allow Unique Styles per Feature" option is set to "Yes".