Armatura Borealis & SPOT tracking

Blue Water Sailing

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

  • mr T05/12/2011

    kan det være det er noe kødd med det store kartet på bws nå? Båten kommer opp i det lille kartet men når jeg går inn for å se stort kart så er det ikke noe der. bare en vennebåt.

  • boundaryfunctions26/04/2012

    Hi Lars-Georg,

    I think you’re totally right about the pre-made widget and what you built here looks really neat! The problem is, that the links to the files seem not to work anymore.

    I’m currently building something similiar for a friend that is cycling around the world. It would be really kind, if you could reupload the files or even start a project on github with these.

    With kind regards,
    Marc

  • Lars-Georg Paulsen16/05/2012

    The files should be working again now, something was wrong with the links. I’ve moved the projected quite fare from what it was… It’s not basicly a WordPress Plugin… But the basic ideas are the same. The only think I would love to do, is move it away from xml and over to mysql… maybe in the future…

  • Christian ROUSSEL30/12/2012

    Hi Lars-Georg,

    I’m currently building a new website for my family to track my sailing boat around atlantic sea. So it would be really kind if you could repair files links.

    Thanks
    Christian

  • Lars-Georg Paulsen30/01/2013

    http://dev.n0ll.com/2013/01/spottracker-plugin-for-wordpress/

    New link, released as wordpress plugin now! 🙂

  • Leave a Comments