.Net Stuff Development General Internet/Links

Google Earth and GeoCaching

I’m torn between two statements “There are two kinds of people on the earth, those who hack a use in Google Earth and those who don’t” and “There are two kinds of people on the earth, those who see the value of Google Earth and those who haven’t yet”.

A short while after the bombs in London someone posted a link to a file that contained the co-ordinates of the various sites where the bombs exploded.  It was a .kmz file and when I “double clicked” it, Google Earth opened and scrolled the locations into view.  It was pretty cool.

For an *AGE* I’ve wanted to do something with the waypoints of geocaches  in South Africa so that I can visually see how far the caches are from my house, and try and plan which caches to get in which order when I go caching.

I knew that gave you the ability to download the cache coordinates, so I set about learning their format (based on the file I downloaded), and I did the same for the Google Earth .kmz file.  Basically they’re both simple XML files (the .kmz file is just a zipped up .kml file which contains XML).  Unfortunately as a non-paying member I can only download the cache locations that are displayed in their grid, so I had to manually change to each page of their grid and download the locations on the page.  

20 minutes later I had them all downloaded, and merged into one big file, and I started processing them.  I’m not the biggest guru when it comes to working with XML so I kinda hacked my way around some XPath queries and XPathNavigators in .Net but I ended up with a pretty easy way to get all the info out of the GeoCaching .loc file, and I then outputted the right format for the Google Earth .kml file.  

The outputting of the .kml file is really bad because I got lazy so I’m not using .Net objects to create an XML Document or anything, I just use Console.WriteLine and write out what I want.  (I’ll fix that when next I have some time.)  But the result is a list of all the caching locations in South Africa.  And here is “Paul’s List of Google Earth Coordinates for GeoCaches In South  Africa” the list as of yesterday (12/07/2005)

[Update: There was a problem with the link to the file – aparently IIS 6 didn’t like the file type, butafter adding a custom mime header thingy to my IIS config, it was all sorted out.]

3 replies on “Google Earth and GeoCaching”

hrm… looks like I have some file permission problems… I’ve mailed the guys who have access to the server to try and get it sorted out. πŸ™

Leave a Reply

Your email address will not be published. Required fields are marked *