Question

Can I influence naming of kml file inside kmz

  • 8 September 2016
  • 6 replies
  • 28 views

Badge +11

Hi Guys,

is there a way to specify the name of the kml file that is created inside a kmz file? I'm writing 3D building models to kmz. It isn't a problem to define the name of the kmz itself, but inside the kmz (which is a zipped kml with the "models" folder containig the collada files) FME creates always a doc.kml.

Thanks for helping

whkarto


6 replies

Userlevel 4
Badge +25

Yes, if you set the Root Document name parameter on the writer it'll change that. It defaults to "doc.kml" if you don't enter anything.

Badge +11

I already tried this, but this parameter only influences the <name> tag of the kml file not the file itself. If you load this file into Google Earth you'll see your given name as Google Earth reads this parameter obviously, but the kml file itself is still named doc.kml

Badge +11

I've found another hint that brought me closer to my desired situation. By specifying attribute "kml_document" on every feature you can control naming of the kml file inside the kmz. Unfortunately the "doc.kml" still remains but doesn't contain any feature information.

If you load such a kml into Google Earth it now depends on the value of kml_document attribute. If you specify something that will be sorted alphabetically in advance of doc.kml you'll see something in Google Earth, otherwise not.

So the question is how to force the OGCKML Writer not to write any doc.kml?

Userlevel 4
Badge +25

It seems like you ought to be able to. Officially there only has to be a doc.kml if there are multiple documents. eg you can have file1.kml, but you can't have file1.kml AND file2.kml, unless there is a doc.kml as well.

The FME documentation says:

Unless explicitly specified, FME will follow the KML specification, and use "doc.kml" as the filename for the dataset's root.

But it doesn't mention how to "explicitly specify" that. I tried a few things without success so I've asked in the office and will let you know what I hear.

Userlevel 4
Badge +25

It seems like you ought to be able to. Officially there only has to be a doc.kml if there are multiple documents. eg you can have file1.kml, but you can't have file1.kml AND file2.kml, unless there is a doc.kml as well.

The FME documentation says:

Unless explicitly specified, FME will follow the KML specification, and use "doc.kml" as the filename for the dataset's root.

But it doesn't mention how to "explicitly specify" that. I tried a few things without success so I've asked in the office and will let you know what I hear.

Looks like it's a known issue with no workaround (or no simple one, anyway). It's PR#47951

 

 

Badge +11

I finally managed to solve the task with help of a python shutdown script. Within FME there doesn't seem to be a way to get rid of doc.kml (thanks to your reply Mark!)

Reply