Armatura Borealis & SPOT tracking
One of my good friends has started on a big adventure. Travling around the world with a sailboat. With 3 friends he set sail from Arendal. And where do I come into the picture? Well, I’ve been helping them building a webpage/blog, with some cool features. And that’s what I’m gonna talk about now!
SPOT-Tracker
On board they have a satellite SPOT tracker.Witch gather and send GPS location to a SPOT service. They make the data available through some interfaces, a pre-made widget and raw XML data. The pre build stuff sux! Sorry, but this should be a lot better so that the “man in the street” can actually get something useful out of it. But for the geek, they also provide XML data. Witch you can do a lot of fun with….
Satellite Tracer
First of, I need to build a widget that would display their whereabouts. Since SPOT provides XML data, it shouldn’t be huge issue. Using PHP’s SimpleXML the task was done quite fast. (After learning about PHP and XML….). When I finished I thought, this is quite good, maybe somebody else would like to use this as well. So I sent an email to SPOT, to see if they would like to publish it on their site. Still no answer from them…
Nothing fancy, and can probably be written better, but it’s clean, small and it works:
File: SPOT.phps
Collection historical data
SPOT only save position for a certain time. I think it only save the last 7 days. And that’s no good if you going on a longer trip! So my first though was to just ‘wget‘ the XML file and save it locally. But I quickly found out that this would be a big mess if you wanna use the data on a later stage. Time to write a XML Data Collector!
Using what I’ve learn from when I built the satellite tracker, and googled my way to add children to an existing XML file, I had the idea, and it was time for some coding.
Due to the add_children function in PHP, you can only add to the end, not append to the top. I had to reverse my xml, so that the latest “message” was saved at the bottom.
File: XMLDumper.phps
And when you do all this, you’ve learn PHP and XML handling, I couldn’t just let it be with this. I had to use my newly created XML files for something useful! Using google API, I could created a map that would show their route from the start too their current posision. Check out Blue Water Sailing – Travle Map
If you wanna see how the widget works. Take a look at http://www.bluewatersailing.no/
**Update:
Playing around with xml/php and google MAP API, I’ve now upgraded TravelMap to include “traveled route”, and with a planed route. The planed route is made i Google Maps, and is controlled by the guys how is sailing. It means that they can put what ever they want onto the map, and it’s automatically updated on the website. Long live KML data! 🙂
Updated map:
5 Coments