Overview
Being the proud owner of a StreetPilot Colormap and also fond of
automatic route plotting (which both StreetPilots lack) and discovering
that Maps On Us has
kindly made available the raw route data on an "As-Is" basis,
I've thrown together a bit of perl to translate this into a
PCX5-compatible route file, which can then be imported by MapSource
(and hopefully other GPS tools that can load PCX5 routes).
The Technical Bits
The program is written in perl 5.6. It was written to 5.x standards
according to the books that I have availible, but this is my first
venture into perl, so my emphasis was more on "Does it work?" than
in following the text exactly, so while functionality with any
version of perl 5 is expected, it's not guaranteed. If something
breaks on perl 5.0 and you fix it, I'd be glad to hear about it.
It processes data from stdin and send results to stdout. The data
it expects is the first block of preformatted text on Maps On Us's
raw route data page. You can either select that whole block of text and
paste it into a text file, or use any other reasonable means to get
that chunk into a file. What I do is pipe the results of wget -q -O -
through the perl and into a file.
- Copy the URL of the raw output page.
- Pull down a copy of the formatted raw output.
wget -q -O - RawRouteURL | mkrte >foo.rte
- Finally, I use the File:Import... option in MapSource to get the
.rte file into MapSource to upload to the GPS.
- When uploading to the GPS, for StreetPilots and other units that
keep route waypoint in a different storage than the "Personal
Waypoints", you can send just the routes to the GPS without
having to send the waypoints.
How To Get It
Bugs
- Biggest problem is that it uses PCX5 instead of generating real
MapSource datafiles. This is a hassle because MapSource can do this
nice thing of separating turns in a route from actual real waypoints,
and the PCX5 import sucks up a real waypoint for every turn in the
route. This could be a problem for GPSs with very limited numbers of
waypoints. An across-the-country trip could easily suck up 50 waypoints
marking turns.
- Only supports a single route per file. This, combined with MapSource's
determination to clear all the existing routes when it imports a new
file makes handling more than one route something of a pain. The workaround
is to stick several route files together, and then change the route number
(on the lines beginning with R) to increase with each route. My program
defaults the route number to "00", and at least allowing that to be
specified on the command line is going to be one of the first improvements
to be made.
Version History
- Version 0.1b
- Update the "Find the start of the raw data
block" search to use pattern matching instead of a raw text string
and now handing it the source of the whole raw data page processes
correctly.
- Version 0.1a
- First release.