Software for DIY off-road navigation

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Different Archives

Unpacking the map data results in either a single IMG file or a directory with a TDB file and an IMG file of the same name. The latter case is a bit easier: No conversion is necessary, and you can read the map directly into QLandkarteGT.

To do so, click the File menu in QLandkarteGT, then Load Map . Next, open the TDB file and immediately afterward the IMG file of the same name. Both bring up the new map that will appear on the Maps tab under Vector . Based on your zoom level, you might see only a white area; by zooming in, you'll eventually see the map details.

Some archives have multiple versions of the TDB files. Then, it's only a matter of finding out which one works in QLandkarteGT without crashing. Now's a good time to get it right, because you'll have other work to do on your trip.

Saving the directory with all the files on a USB stick lets you load them on your travel netbook. The USB stick then must be plugged in all the time, or you can copy the directory onto the netbook's SSD.

If the map is a single IMG file, you'll need to extract the individual grids (as IMG files) and the TDD file from it.

To do so, copy the programs GMapTool and cGPSmapper-static in the directory and start a terminal window. In it, change to the directory where the map and both programs are and execute the following commands:

$ ./gmt -S <file>.img
$ ./cgpsmapper-static mapset.mp

For file , use the name of the map file that you get after unpacking; mapset.mp is a fixed name.

Whereas GMapTool chops up the IMG into grids, cGPSmapper-static creates the mapset.img and mapset.tdb files, which you then load with QLandkarteGT as described earlier. Again, you copy the whole directory to the USB stick to load it on the netbook.

Downloading OSM Maps

A few sources provide ready-made maps in OSM format – the original format of the OpenStreetMap project. An especially good source is the GeoFabrik server that includes numerous OSM maps that are updated daily.

I tested the reasonably-sized OSM map of Portugal. The corresponding portugal-latest.osm.bz2 file had a size of 110MB after downloading. Upon decompression, the portugal-latest.osm file took up about 1.5GB space.

The first attempt at converting the map with Mkgmap into a format readable by QLandkarteGT returned an error that the map was too big and, therefore, needed to be broken up.

The Mkgmap homepage recommends the Splitter [10] program for this purpose and provides the matching download link. After setting up the small Java program (see the "Setting up Splitter" box) change to the OSM map's directory. There you enter the command for splitting up the file (Listing 1, line 1).

Listing 1

Splitting the File

01 $ /usr/lib/jvm/java-7-openjdk-amd64/bin/java \
  -jar path-to-splitter-version/splitter.jar ./portugal-latest.osm
02 $ /usr/lib/jvm/java-7-openjdk-amd64/bin/java -jar path-to-mkgmap-version/mkgmap.jar \
  --route --add-pois-to-areas --series-name="name-of-map-in-register"\
  --index --tdbfile 6324.osm.pbf

Setting Up Splitter

Both Mkgmap and Splitter are Java programs that you can download from the Mkgmap project [8]. The project is quite active and the versions change often. Obtain both program as packed (TAR.BZ or ZIP) JAR archives that you can unpack in your favorite directory without further installation.

To determine whether the JRE is already installed and which version, look in your /usr/lib/jvm directory. The directory contains the various Java versions. The one you need for Mkgmap and Splitter is the Java 7 OpenJDK for your architecture.

If /usr/lib/jvm doesn't include a matching Java 7 version, install the OpenJDK Java 7 JRE either from the Ubuntu Software Center or directly from the Oracle [9].

The portugal-latest.osm Portugal map took a good 11 minutes to process. The map directory is then filled with many map segments that you process further with Mkgmap. Next, execute the second command on the next line in Listing 1.

The --tdbfile option serves to read the resulting map directly into QLandkarteGT. The --series-name option specifies the name under which the map should appear in QLandkarteGT's map register.

In the Portugal example, I had data collection readable by QLandkarteGT after about three and a half minutes. Even with a comparatively smaller map like Portugal's the map preparation process can be resource-consuming, so you should never do this in your netbook.

Buy this article as PDF

Express-Checkout as PDF

Pages: 9

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content