Skip to main content
Best Answer

How do I get the folder name for my features stored in a KML/KMZ file?

  • September 30, 2016
  • 4 replies
  • 253 views

fmelizard
Safer
Forum|alt.badge.img+21

When I open my KML file in Google Earth, I can see the data displayed in folders in the table of contents. When I use the KML reader to read the data, that folder name doesn't show up on my features. How do I get that out?

Best answer by laurawatsafe

The folder name isn't added as an attribute onto placemarks read from KML directly. The folders themselves are read separately as a feature type called Folders. The Placemarks will have a format attribute added to them called kml_parent which contains an id value that will match the kml_id from one of the Folder features. To add the folder name onto the Placemarks, you can use a FeatureMerger transformer to join on those two attributes.

Here's a sample template file to show how that would look within FME: kmlgetfoldername.fmwt

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

laurawatsafe
Safer
Forum|alt.badge.img+13
  • Safer
  • Best Answer
  • September 30, 2016

The folder name isn't added as an attribute onto placemarks read from KML directly. The folders themselves are read separately as a feature type called Folders. The Placemarks will have a format attribute added to them called kml_parent which contains an id value that will match the kml_id from one of the Folder features. To add the folder name onto the Placemarks, you can use a FeatureMerger transformer to join on those two attributes.

Here's a sample template file to show how that would look within FME: kmlgetfoldername.fmwt


  • August 11, 2021

Where can I find the file described above (​kmlgetfoldername.fmwt)?


laurawatsafe
Safer
Forum|alt.badge.img+13

Where can I find the file described above (​kmlgetfoldername.fmwt)?

Thanks @kerkhoff​! I'm attaching that file to this comment.


  • August 18, 2021

Thanks @kerkhoff​! I'm attaching that file to this comment.

Thanks Laura at Safe.