Adding a map to the blog

I wanted to show a map of the track and location of Vingilótë. It works and you can find it at Where Are They Now?. It is manually updated: taking live data and doing it automatically (though, likely delayed), is the next bit of free time programming.

Detail

Vingilótë has a ridiculous number of ways to track her location off of GPS:

  1. KVH V7HTS. The main satellite system is always on and knows where it is off of the comms satellites it tracks.
  2. Garmin InReach. It tracks location, altitude, speed, course off of GPS and more every ten minutes, and on every other event (messages sent/received) and more.
  3. SPOT Trace GPS tracker. It logs location off of GPS every ten minutes.
  4. The Raymarine chart plotter tracks its location, speed, course, heading, etcetera, off of GPS, continuously and logs it.

But how to get at it?

  1. KVH V7HTS. The satellite uploads its locations to the portal. It sends me messages every noon and midnight with its location.
    NOT: The KVH does not upload speed and its portal has not been able to give me a download.
  2. Garmin InReach. The Garmin uploads its locations and all events to the Garmin InReach portal.
    YES: The Garmin InReach data is rich, the KML export from the private portal includes all the data in the placemarker sets and it generates a track between them already. Furthermore, they have an Account API to automate this as a next step!
  3. SPOT Trace. The SPOT uploads its location every ten minutes to the SPOT portal.
    NOT: The SPOT does not upload heading or speed.
  4. Raymarine AIS700. Transmits location, speed, course over radio. It is uploaded to satellites.
    NOT: AIS satellite upload is spotty in the middle of the ocean with minimal satellite coverage and in a busy (as oceans go) stretch where commercial vessels with Class A AIS transmitters have priority in the limited number of satellite upload slots available.

First step was generating the KML, uploading it to the webserver, and plugging it as an overlay into the WordPress plugin I use for maps (WP Google Map Pro), showing the map on a new page, and linking the page to the main menu.

It worked, but needed some tweaking with the size and center of the map, adding departure and destination points and the KML generated by Garmin was not great. It used a blue thin line and large icons. A bit of experimenting with regular expressions, to change the colors, thicken the line weight, change the Icon on the waypoints, strip PlaceMarker sections of messages and device status changes. Then cleaning up the popups by editing the HTML-encoded HTML to only show the fields I wanted. Once that was working, encoding those in sed and a bit of bash scripting to take the latest file, run it through sed, rename it and scp it to the webserver.

2 comments on “Adding a map to the blog
  1. Avatar Wesley E. Snyder says:

    Oh my God, a sed programmer!

  2. Avatar LARRY says:

    Nice hacking job.
    Respect!

Leave a Reply

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