[GIS] KML/KMZ: Make one placemark appear in two folders

google earthkmlkmz

I'm not actually sure this is quite the right way to approach this problem, so if I'm just off in the wrong direction, please help me figure out where I should be heading.

I have a collection of several hundred geolocated items, each of which is tagged with one or more attributes. I want to save the items as a KML/KMZ file such that it's trivial for a Google Earth user to show/hide the items based on their tags. Right now, I've just got a folder for each tag, and the items duplicated between folders, so there might be three copies of one item across three different folders. This works great if the user only wants to look at one tag at a time — just select that folder and deselect the others. However, of course, if you've got 2+ folders selected, you wind up with duplicates of the same item showing up on the map.

Is it possible to have a single placemark which is "symlinked" into more than one folder, such that if it's in two folders and both are enabled, only one copy of the placemark will actually appear on the map?

If not, is there some other useful mechanism within the KML/KMZ format that will give me the sort of functionality I'm looking for?

Best Answer

The only way to have the same placemark appear in two folders in KML is 1) duplicate the placemark or 2) have NetworkLink in each folder reference the placemark in a separate KML file.

In both cases, if both folders are visible then the placemark is duplicated on the map which may or may not be apparent. Google Earth does not remove duplicates. If user clicks on the placemark then the icon will appear twice on the map. If the placemark is a point then the icon will only show once but the name label will appear twice (unless name is hidden via the LabelStyle).

One way to prevent the same item from being visible from two folders is making the folders use a radioFolder list style. That way only one folder and one placemark can be visible at a time.

Related Question