After looking through various KML samples on the web during lunch today, I spent a little time experimenting with converting my existing location data into something that Google Earth could read – allowing people to track my location in real time.
Manual labour
About 6 times per day, I press a button on my phone and it sends a text message to my website with my current cell tower ID. My website then takes over and does all the smart stuff by itself. If I’ve traveled somewhere new, it automatically looks up the cell ID in a large UK database using their API to find the latitude and longitude of the cell tower I’m currently connected to. But big decimal numbers showing my current latitude and longitude aren’t all that interesting on their own.
Sidebar widget
The next step in my process was to add the widget on the side of my website to show everyone my current location. It’s not particularly fascinating – either I’m in my home town, at work, or traveling somewhere in between. But I’ve just added something a little more interesting.
Google Earth
Whereas before the link on my current location just took you to the coordinates where I’m currently sat, it will now load up a KML file showing a nice picture of a man standing on my current location, and hopefully a number of little cell towers which will show where I’ve been over the last 7 days.
The historic data isn’t all that interesting in Google Maps, but if I open up my KML file in Google Earth then I expose the timeline controls and I can choose to see where I was at different times and even animate my location over time.
What’s next?
I’ve got a habit of always wanting to do more. I’ve cleaned up my location database so I could add in other locations (i.e. not just cell towers) and try plotting even more data. I’d like to try the following:
- Load up GPS data for any hikes I go on
- Add a few key locations onto the map such as the Scout hut, my brother’s place in Canada, anything relevant to me
- Add some kind of refresh so that it updates automatically when I’m on the move
- Create some kind of JavScript timeline interface for Google Maps