DIY garmin routable map from openstreetmap data

garmin gps

A new Openstreetmap Garmin Map of the Philippines is now available in my wiki. The latest update was based on 20090225 OSM data.

New in this update are:
- 33,000 km. of roads;
- more POIs and improved POI searching for roads and cities;
- improved road data in Mindanao;
- fixed problems with abbreviated POI names in Garmin Mobile XT .

Here’s the link for the direct download.

 

(Go to the wiki for the daily map updates)

Some people asked me how to convert the OSM data to Garmin maps. There are several options you can do this. The following process outlines how I do it using mkgmap.

From the wiki: “mkgmap converts OpenStreetMap data into a map that can be loaded onto a Garmin GPS device. It does the conversion in one step without depending on any other program. It requires Java 1.5.”

The java environment makes it easy to prepare the map in any OS.

The process is in 4 general steps: build mkgmap, get data, convert data, transfer to gps. This process was tested using Ubuntu Linux and Mac OS (it should be the same with to WinXP). What you need are OSM data, java 1.5 0r 1.6, command terminal (command prompt in windows speak) and subversion (optional)

The text in this font is what you type in your terminal

Get mkgmap
You can get a daily snapshot of mkgmap from the website. Then, decompress the file. Open a terminal and type:


cd /path/to/your/mkgmap/directory
java -jar mkgmap.jar

The last command should give you the help text on usage and options.

However, current mkgmap development is in high gear and new features are added every week. This is why is use the trunk nod branch.

To get latest trunk nod svn snapshot, in the terminal type the following:


mkdir mkgmap
cd mkgmap
svn co http://svn.parabola.me.uk/mkgmap/branches/trunks trunk

Building the source

cd trunk
ant dist
java -jar dist/mkgmap.jar

Get the data
Now you want to get the latest OSM data, you have several options.
1. I previously wrote about using OSM for your website. Follow the steps from 1 to 2. From the export tab, select “OpenStreetMap XML Data” option to get the OSM data. This is OK if you want to get the data for small areas.

2. For large areas, use the the HTTP API or osmxapi

3. Or simply get them from CloudMade. CloudMade provides free country-wide download of OSM’s weekly data dump.


wget http://downloads.cloudmade.com/asia/philippines/philippines.osm.bz2

Decompress the file.

Convert the data to Garmin img
Again in the terminal, run the following command:


java -jar mkgmap.jar [options] data.osm

The exact command I use is below (remove the “\” and type the syntax in one line):


java -Xmx512m -jar mkgmap.jar --code-page=1252 \
--tdbfile --gmapsupp --latin1 --country-abbr=PHI \
--country-name=PHILIPPINES --road-name-pois --route \
--description="Openstreetmap Philippines" \
/path/to/your/data/philippines.osm

This will produce a file called 63240000.img, 63240001.img, 63240000.tdb and gmapsupp.img. You need to transfer the gmapsupp.img file to your GPS unit.

Transfer the map to your Garmin unit
My Garmin eTrex Legend Cx micro-SD Card can be directly read as another filesystem on my Linux. Just copy the map to the file Garmin/gmapsupp.img. You can also use sendmap to transfer the gmapsupp.img to your unit.

Now go out and test your OSM map!

Lately, I have been struggling in creating a Mapsource installer. I haven’t found a straight forward way without using CGPSmapper utility. Any tip on this? I will post another entry when the issue with Mapsource is resolved.

Another blog I plan to do is making this map:

San Mateo made with OSM Map Composer

Note: Most of the instructions above were copied from the OSM wiki

UPDATE: Several suggestions from the mkgmap-dev list.
Replaced nod to trunk since nod branch was merged already to trunk.

About these ads

15 responses to “DIY garmin routable map from openstreetmap data

  1. Pingback: google mapmaker and openstreetmap (it’s the LICENSE) « 4253·

  2. Pingback: DIY garmin routable map from openstreetmap data into mapsource (win) and roadtrip (mac) « 4253·

  3. Excellent product. This has saved us much time. Though at first we had to learn to trust it. Once trust is established use it to the fullest and have fun with the Point of Interest.

  4. Thanks!

    Trusting openstreetmap data is like how you trust some content in wikipedia (not really an exact comparison, but you get the idea).

    It is only as good as what the contributors added.
    Enjoy the map! Hope you can join in making it more trustworthy. :)

  5. I don’t understand your instruction on how to create a GPS map from OSM.. Can you send me a sample on how it really works.

    Thanks.

    Delfin

  6. Which part of it that you don’t understand? Most syntax can be run in a shell.

  7. Hi,

    I was confuse for the OSM, what is it? And where can i get an OSM map?

    Can you send me a step-by-step porcedure, and also the software needed.

    Regards,
    Delfin

  8. Pingback: New styles and contours « 4253·

  9. Hey, I am slowly plugging thorugh this, but come up against a couple of barriers.
    Firstly the http://svn.parabola.me.uk/mkgmap/branches/nod nod
    site does not seem to work:

    svn: URL 'http://svn.parabola.me.uk/mkgmap/branches/nod' doesn't exist

    How much does this section affect the performance of mkgmap as I haven’t seen this referred to on other advice sites?

    Secondly
    I have created a few OSM maps now as part of my process of figuring this out. I have one that I have taken from informationfreeway.org, using coordinates (I am trying to get map of Hong Kong).
    I have saved this as HK.osm, but when I use the code, adapted from your version, I get the following messages generated & no evidence of an .img file. I have tried the following country names: Hong Kong, Hongkong, hongkong, country, china.

    Please can you give me any tips on where I am going wrong?

    java -Xmx512m -jar mkgmap.jar --code-page=1252 --tdbfile --gmapsupp --latin1 --country-abbr=HK -country-name=country --road-name-pois --route --description="Openstreetmap HongKong" /home/aliale/mkgmap/HK.osm

    unrecognised option -country-name=country
    SEVERE (RoadNetwork): /home/aliale/mkgmap/HK.osm: Road (Sham Mong Rd, http://www.openstreetmap.org/browse/way/40662581) contains zero length arc at http://www.openstreetmap.org/?mlat=22.33154&mlon=114.14881&zoom=17
    SEVERE (RoadNetwork): /home/aliale/mkgmap/HK.osm: Road (Pak Lam Rd, http://www.openstreetmap.org/browse/way/40484543) contains zero length arc at http://www.openstreetmap.org/?mlat=22.34973&mlon=114.05963&zoom=17
    SEVERE (RoadNetwork): /home/aliale/mkgmap/HK.osm: Road (Pak Lai Rd, http://www.openstreetmap.org/browse/way/40484583) contains zero length arc at http://www.openstreetmap.org/?mlat=22.34973&mlon=114.05963&zoom=17
    SEVERE (RoadNetwork): /home/aliale/mkgmap/HK.osm: Road (Choi Ming Street, http://www.openstreetmap.org/browse/way/27993119) contains zero length arc at http://www.openstreetmap.org/?mlat=22.30392&mlon=114.24850&zoom=17
    SEVERE (RoadNetwork): /home/aliale/mkgmap/HK.osm: Road (馬頭角道 Ma Tau Kok Road, http://www.openstreetmap.org/browse/way/85200968) contains zero length arc at http://www.openstreetmap.org/?mlat=22.32164&mlon=114.19054&zoom=17

    Many thanks!

  10. Sorry to pester with another question, I have tried again with a slightly different map & get this:
    aliale@aliale-laptop:~/mkgmap$ java -Xmx512m -jar mkgmap.jar --code-page=1252 --tdbfile --gmapsupp --latin1 --country-abbr=CHI --country-name=CHINA --road-name-pois --route --description="Openstreetmap Hong Kong" /home/aliale/mkgmap/HK1.osm
    SEVERE (RoadNetwork): /home/aliale/mkgmap/HK1.osm: Road (Choi Ming Street, http://www.openstreetmap.org/browse/way/27993119) contains zero length arc at http://www.openstreetmap.org/?mlat=22.30392&mlon=114.24850&zoom=17

    I am guessing that there is something wrong with a road having a zero length arc? Maybe this road is truncated on my selection of the area. Or I am completely wrong…
    Any ideas?! I am totally out of my depth on this one!

  11. Alexis,

    To answer a few of your questions.

    1. nod branch is now removed (I wrote this article when the routing is still in experimental stage). You can use the trunk instead.

    2. Check the reported data problems, I noticed two ways segments have some errors (I fixed them already).
    However, I don’t think this should stop mkgmap to continue compiling the map. Try adding this switch: –keep-going

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s