Filter Placemarks by Attributes

1,211 views
Skip to first unread message

ChrisB323

unread,
May 18, 2007, 2:17:34 PM5/18/07
to KML Developer Support - Advanced Support
I have a database that has objects with certain attributes. Not all
objects have all attributes. I want to put these objects into Google
Earth and turn on/off various attributes, screening the placemarks
that appear on the map.

Basically, I have database of gas stations in my area. I track which
offer certain services, i.e. A=E85, B=state vehicle inspections,
C=basic auto repair service, D=car wash, etc. I would like to plot
the entire universe of gas stations, and filter them by attribute.

Is there any way to create one KML file that allows this
functionality?

Thanks!

ManoM

unread,
May 21, 2007, 11:11:55 AM5/21/07
to KML Developer Support - Advanced Support
Hi ChrisB323,

You could come close in KML, but only if you're willing to duplicate
information. You could store each of your attributes in a separate
Folder, like this:

<Folder>
<name>E85</name>
....[a bunch of placemarks]
</Folder>
<Folder>
<name>State Vehicle Inspections</name>
[a bunch of placemarks]
</Folder>

The problem is one Placemark may qualify in both of those Folders, and
will appear in both of them.

One solution may be to have people put their requests in via a web
page and have a script that generates the KML automatically.

ManoM

timf...@gmail.com

unread,
Jun 4, 2007, 2:49:22 AM6/4/07
to KML Developer Support - Advanced Support
Being able to add an 1 or more attributes to displayable items
(Placemarks, LineStrings, etc.) and then be able to filter
individually on these attributes using a lower level checkbox to the
network link would be hugely valuable. Is there any plan for this
sort of functionality?

Thanks,
Tim

ManoM

unread,
Jun 4, 2007, 2:32:07 PM6/4/07
to KML Developer Support - Advanced Support
Hi Tim,

The only future plans for KML that Google has made public are in the
KML 2.2 beta reference, available at:
http://code.google.com/apis/kml/documentation/kml_tags_beta1.html

Please note, very much a beta document!

ManoM

Reply all
Reply to author
Forward
0 new messages