Skip to main content
Question

extracting information from different folders from KML

  • December 9, 2024
  • 6 replies
  • 83 views

abnan0001
Supporter
Forum|alt.badge.img+7

Hi All

I would like to extract the information of each folder and sub folder in different field with the folder and sub folder names as snapshot attached.I have 4 Main folder and  sub folders for each.

 

 


In a new column lets called : folderdetails - Active camera traps , Removed camera traps etc this has to be taken.

Similarly for sub folders also

Any guidanxce and support , I have tried doing but im not getting the way i should i needed


 

 

6 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

.kmz is .kml in an archive, which is XML, I think I would try to do this using XML transformers.


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • December 9, 2024

You may be able to get what you are wanting from the KML reader if you expose more of the kml format attributes (there are a lot). For folder names and identifying what folders they are in I believe the ones that you want are kml_parent, kml_id, and kml_name.

When you read in your KMZ you can choose to between individual feature types or merged. Either will work but if you choose individual then you will get a Reader FeatureType called Folders separate from your data. Once you read in the data, the kml_name attribute is the display name of the folder and the kml_id is the id of that feature/folder (could be the same as the name but may not be). The kml_parent is the kml_id of the folder that each folder or feature is in.

 

This guide is for creating kml folder structure in fme, but it may help explain how the attributes are working: https://support.safe.com/hc/en-us/articles/25407754952717-Creating-KML-Folders-Through-KML-IDs


abnan0001
Supporter
Forum|alt.badge.img+7
  • Author
  • Supporter
  • December 18, 2024
liamfez wrote:

You may be able to get what you are wanting from the KML reader if you expose more of the kml format attributes (there are a lot). For folder names and identifying what folders they are in I believe the ones that you want are kml_parent, kml_id, and kml_name.

When you read in your KMZ you can choose to between individual feature types or merged. Either will work but if you choose individual then you will get a Reader FeatureType called Folders separate from your data. Once you read in the data, the kml_name attribute is the display name of the folder and the kml_id is the id of that feature/folder (could be the same as the name but may not be). The kml_parent is the kml_id of the folder that each folder or feature is in.

 

This guide is for creating kml folder structure in fme, but it may help explain how the attributes are working: https://support.safe.com/hc/en-us/articles/25407754952717-Creating-KML-Folders-Through-KML-IDs

Thanks for the reply.

Guide provide about creating the KMl with Multiple sub folder and this is something similar which i need reverse order from KMZ to FC..

What I did was

I have created 4 KMl as per folders created and then extracted the details then did some transformation by clubing all of them , This was just a workaround i did.

Any Guidance for this if we have multple sub-folders inside a folder in KML 

Thanks


debbiatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • January 7, 2025

Hello ​@abnan0001 

To handle multiple folder sublevels, you could try using the kml_parent attribute of the Placemark features to find how many levels of folders each Placemark has, and then cloning the feature once for each level of folder from the KML root.

The important part is creating a join key that identifies the correct folder sublevel so these cloned features can be joined to a Folder feature via the Folder features’ kml_id. Once joined to the Folder features, use an Aggregator to combine the cloned Placemark features based on the kml_id. You should now have all folder details for a Placemark feature.

Attached is an example workspace that demonstrates this approach and I hope it helps.


adnanyazdani
Contributor
Forum|alt.badge.img+2
  • Contributor
  • January 7, 2025

Thank you so much

I will go through the example and follow the instructions

Thanks Again


danilo_fme
Evangelist
Forum|alt.badge.img+43
  • Evangelist
  • January 18, 2025
debbiatsafe wrote:

Hello ​@abnan0001 

To handle multiple folder sublevels, you could try using the kml_parent attribute of the Placemark features to find how many levels of folders each Placemark has, and then cloning the feature once for each level of folder from the KML root.

The important part is creating a join key that identifies the correct folder sublevel so these cloned features can be joined to a Folder feature via the Folder features’ kml_id. Once joined to the Folder features, use an Aggregator to combine the cloned Placemark features based on the kml_id. You should now have all folder details for a Placemark feature.

Attached is an example workspace that demonstrates this approach and I hope it helps.

Great reference ​@debbiatsafe 


Reply


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