So I thought, ahead of new year, I should just prove end-to-end the components of the GPSd service. What better way than to plot our current position on a map.
Using a converted version of the GPSd client, that we talked about previously, I parse the NMEA data coming from the GPS and produce an XML file of the following -
<?xml version="1.0" encoding="utf-8" ?>
<movingmap>
<latitude>51.267</latitude>
<longitude>-1.108</longitude>
<bearing>182</bearing>
<speed>90</speed>
<altitude>3000</altitude>
<timestamp>0950</timestamp>
</movingmap>
This process runs continually only when we have a valid GPS position (this is important to avoid getting really lost). I haven't quite finished this bit, but will post it when complete.
Now the fun bit. Using a very simple web page and a little bit of AJAX, we plot a map using Virtual Earth. Then using AJAX we poll our XML location file every 5 seconds. We then parse the returned XML and draw an icon on the map.
The icon can of course be anything you like, I've chosen an executive jet :-)
The illusion is then complete, we have a continually updating map showing our current location from wherever the GPSd is running.
I guess, I was thinking that this would be a great web-page to available when you initially connected to the aircrafts/ships wireless network.
Full source
NMEA parser to follow.
Please let me know if this application is of any use to you?
Happy New Year!