Go to placemark when using the address tag

111 views
Skip to first unread message

retro85

unread,
Jul 17, 2006, 7:27:47 PM7/17/06
to KML Discussions
I have created a KML file that uses the address tag. It works just fine and does create a placemark where it is supposed to. What do I need add to have GE automatically go to that placemark when the KML file is opened? I have tried using the lookat tag when I have the coordinates, but that doesn't seem to work when I only have the address.

Here is my simple KML file :

<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
<description><!CDATA[<a href="http://www.google.com/">Google Search!</a>]]></description>
<name>Google Headquarters</name>

<address>1600 Amphitheater Pkwy, Mountain View, CA</address>

</Placemark>
</kml>

Thanks. Probably an easy solution but it has me baffled.

barryhunter

unread,
Jul 18, 2006, 7:16:05 AM7/18/06
to KML Discussions
I haven't tried it myself, but I believe users have had some success with wrapping the placemark inside a NetworkLink* and using a <flyToView> on the container networklink.

*Just have a network link KML that points to the location of the KML placemark file online somewhere...

Barry

Calico_Jack

unread,
Jul 19, 2006, 9:27:31 AM7/19/06
to KML Discussions
Note that when you load a .kml file using the <address> tag only, that a new file is created following geocoding; the new file will actually have the coordinates of the address. Rather than do a geocoding lookup every time you load your original file, you might want to consider saving the generated file (since it has the coordinates it doesn't invoke a geocode lookup and will work a whole lot faster).

retro85

unread,
Jul 20, 2006, 12:56:09 AM7/20/06
to KML Discussions
All right. Thanks for the the replies.

I see your point on saving the KML file after the fact, but I have a large database and application with thousands of addresses. I just thought a nice feature to have when looking at a record/address would be a button you could click that would fire up GE and then fly to that address. I don't really want to geocode the database, as this would not be a feature that is used all that often.

I guess if this is not an easily do-able option then it would lead into a second question. How difficult is it to dynamically geocode an address? If I could do that through code, then I could just use the coordinates when I generate my KML file and the fly to would work just fine. I have seen a few sample web pages that do this for you, but I was not sure how they were doing the geocoding behind the scenes.

Thanks again for the help.

Calico_Jack

unread,
Jul 20, 2006, 2:17:11 PM7/20/06
to KML Discussions
I understand what you're getting at (not wanting to geocode an entire database). The whole concept of geocoding was new to me when I first started dabbling with Google Earth, and I found the wikipedia article at:

http://en.wikipedia.org/wiki/Geocoding

to be very helpful for an overview. It's actually quite a fascinating area of endeavor (but I'm weird). There's a lot of info on this BBS about geocoding as well; for the longest time I had no idea what they were talking about!

Seems like someone's going to have to chime in with the correct .kml syntax (if possible) to do what you want with the <address> tag, or you need to have an intermediate geocoding step to look up the coordinates of the address, and then generate a placemark from that. I agree that the former would be much more elegant.

FYI, I've found that for the US, a street number and name, and the zip code are sufficient for an address to be correctly geocoded.

e.g., 1640 Lindbergh, 63131

Final note, geocoding often results in imperfect results. The address above is for the St. Louis County Library HQ, but the GE lookup placemark coordinates returned place it about 100 yards away in a totally different building. This is primarily due to interpolation of location between two datapoints. I.e., the first location on a block gets a lat/lon as does the last location; everything between is interpolated with the sometimes erroneous assumption that each building/house is on identically sized plots of land.

I love this stuff!
Reply all
Reply to author
Forward
0 new messages