GPSDrive is a sweet gps navigation program, but it is pretty much useless unless you can figure out how to configure it and download maps. The single map download functionality is nice, but way to hard to get all the maps for a certain area. I am going to explain how to get the multiple map download script gpsfetchmap.pl working on ubuntu.
You need Perl in order to run a .pl script. Im going to assume you already have it. The next thing you need is image magick, then the
image magick extension for Perl called perlMagick most likely seen in errors for gpsfetchmap.pl as Image::Magick
You have to install both ImageMagick and perlMagick from the command line. Its really simple thanks to apt in ubuntu. The commands to run assuming you already have GPSdrive installed from ubuntu add ⁄ remove programs and Perl installed. Perl should be installed by default are as follows
sudo apt—get install imagemagick
sudo apt—get install perlmagick
This will fix the error with gpsfetchmap.pl that complains about Can't locate Image ⁄ Magick.pm.
So now lets take a big leap and assume that you can actually run gpsfetchmap.pl I live in Massachusetts and want to download maps for the whole state. Whats the command to do it? The first thing we need to do is figure out the latitude and longitude boundaries of the state.
I went to
itouchmap and zoomed in on Massachusetts then dragged the little red icon to each of the four corners of the state and recorded each latitude and longitude (in the box on the left below the map). The results I got were as follows:
Top Left:
Lat: 42.7389
Long: —73.2788
Bottom Left:
Lat: 42.0533
Long: —73.4985
Top Right:
Lat: 42.7026
Long: —70.8123
Bottom Right:
Lat: 41.5414
Long: —70.3344
Now we need to construct the command for gpsfetchmap.pl
In order to get a list of the available command line switches we run:
perl gpsfetchmap.pl ——help
There are some options that we need to use.
—p : rest 1 second between server requests — use this. I have written web spiders before and if you hammer a server it will just stop responding to you or may think your preforming a DDOS attack.
—sc a range of scales (min: 2250 max: a lot!. This is good. Lets use 2250 — 152000
NOTE: This wasnt working properly. So I specified single scales and ran the command multiple times.
—F force the application not to prompt you on each map download
—d prints out diagnostic information in case of errors we want to see this
I want to use these for driving around not the landsat maps(default) for topology. So we need to switch the map server to use
openstreetmap
——mapserver openstreetmap_tah
We want to specify a start latitude, start longitude, end latitude and end longitude which make up two opposite corners of a square. So from the measurements above that we used google maps for, we will be using the Top Left and Bottom Right values. The associated commands are:
——start—lat
——end—lat
——start—lon
——end—lon
Here is the full command to get a very detailed street map of Massachusetts:
perl gpsfetchmap.pl ——start—lat 42.7389 ——start—lon —73.2788 ——end—lat 41.5414 ——end—lon —70.334 —p —F —d —sc 2250 ——mapserver openstreetmap_tah
These .png images will be written to whatever you set your default map directory to in gpsdrive
I would recommend that you run the command above a few times with multiple sc values so you can zoom in and out if you have room for it. I used —sc values of 2250 (probably too close), 36000, and 18000
I hope this has helped shed some light on how to actually make GPSDrive usable.