Hi, I have an FME workbench that outputs a KMZ but i want to create a folder tree style for ease of view. Currently it outputs as below:
I have been unsuccessfully trying to create a tree which will output something like this: Proper name instead of doc (folder) → operating_voltage (folder) → feeder_name (folder) → actual feeder spatial data .
Creating multiple folders levels has been a bit more complicated from my experience, I generally try to avoid it when possible. I will check to see if I have a good example for you. The general idea for how I have solved this in the past:
You need to create the folders you want, each folder will be each own feature. The folder features will have attributes defining their structure and will get written to a Folder feature type by the OGCKML writer. While the rest of your data gets written to its own feature type, but with attributes detailing where they belong in the structure.
I do not know exactly what your data is like, but I created a quick example of how you may need to set this up. Hopefully it helps. I am not sure if this is the best way to achieve what you are desiring, but it is the method I have used successfully in the past. I can try to answer more questions if you have them.
Pretending your data is being written out by state and county, I set the Root Document name as County_State. While this is the name, the document will still be referred to as doc when you reference it in the folder creation.
You will need to create each folder and subfolder as its own feature, with at least 3 attributes: kml_document, kml_parent, and kml_id. You can use kml_name to rename the folder to something other than the kml_id if desired.
In both the folder and subfolder, you create kml_document = doc. In the first folder you can see the kml_parent name is the name you set in the Root Document name. I am not sure what your folder names will look like but I demonstrate in the sub folder adding a space to the display name, while the ID stays the same.
For all of your features you will need to create a kml_parent attribute which will be the kml_id of the subfolder that they will go in.