Skip to main content
Solved

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

  • September 30, 2016
  • 4 replies
  • 203 views

fmelizard
Safer
Forum|alt.badge.img+19

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

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

4 replies

laurawatsafe
Safer
Forum|alt.badge.img+11
  • 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+11
kerkhoff wrote:

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

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


  • August 18, 2021
lauraatsafe wrote:

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

Thanks Laura at Safe.

 


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