From OpenStreetMap Wiki
Jump to: navigation, search

Do-It-Yourself Up-To-Date Routable & Topographic Maps

This is a description of a fully automated process from fetching OSM from openstreetmap over creating mp and img to having a routable map on a Garmin device. It may seem lengthy at first, but it is intended that new users understand it at first sight. And each step is more or less trivial.

The description is for Windows XP. Linux users will probably not have too much trouble modifying the workflow.

Parts I to IV are some kind of installation process on your PC. Only V and VI need to be carried out for each new map.

Hint: start with a small map (zoom level 11 or 12), so things go quickly, as long as you are still trying. Then once you've succeded building your first map, take a look at advanced issues on Topographic maps for garmin devices.

Part I: Required software

- GroundTruth
- mkgmap
- Sendmap
- osm2mp (if you do not know what subversion is use )
- srtm2osm

Part II: Create Folders

To have the batch file at the end of this post running right away, create a folder with a name like "MapManager" (anywhere on your HD) In this folder create subfolders
- GroundTruth
- MKGMap
- Sendmap
and unzip the programs to their corresponding folder.

Part III: Batch file for the whole process

In "MapManager" create a batch file "ManageMaps.bat" that looks like

set NAME=Luxembourg

@echo =========== ====== ====
GroundTruth\groundtruth getdata -bu=""

copy output.osm MAPS\%NAME%\%NAME%.osm
del output.osm

@echo =========
java -Xmx1000m -enableassertions -jar ..\..\Splitter\splitter.jar %NAME%.osm

@echo ======== ====== ====
java -Xmx1000m -enableassertions -jar ..\..\MKGMap\mkgmap.jar --net --route --latin1 --family-id=11 --family-name=Street 63240001.osm.gz

echo java -Xmx1000m -enableassertions -jar ..\..\MKGMap\mkgmap.jar --net --route --latin1 --family-id=11 --family-name=Street 63240002.osm.gz
echo You might need more of these lines, depending on how many .osm.gz files are created by SPLITTER. Count up the number at the end o the file name.

@echo ========== =========== ====
..\..\SRTM2OSM\srtm2osm -step 25 -cat 400 100 -large -bounds1 49 5 50 6 -o 53273440.osm > output_srtm2_a.txt
..\..\SRTM2OSM\srtm2osm -step 25 -cat 400 100 -large -bounds1 49 6 50 7 -o 53273620.osm > output_srtm2_b.txt

java -Xmx1000m -enableassertions -jar ..\..\MKGMap\mkgmap.jar --latin1 --family-id=22 --family-name=Topo 53273440.osm
java -Xmx1000m -enableassertions -jar ..\..\MKGMap\mkgmap.jar --latin1 --family-id=22 --family-name=Topo 53273620.osm

@echo ========= ====== === ====
java -Xmx1000m -enableassertions -jar "..\..\MKGMap\mkgmap.jar" --gmapsupp --tdbfile --net --route --latin1 63240001.img 53273440.img 53273620.img

@echo ======= ===
..\..\Sendmap\sendmap20 gmapsupp.img

@echo DONE

Part IV: Choose a part of the world map

- go to
- select a viewport you want to end up on your Garmin
- click Permalink on the lower right of the page
- select the URL and press Ctrl-C

Part V: Modify ManageMaps.bat, start the process, wait

- Modify the first line with a name describing your openstreetmap view (i.e. replace "Luxembourg" with the name of the region of your map viewport) and the URL in the sixth line via Ctrl-v with the corresponding URL.
- Go back to your browser showing the OpenStreetMap viewport, enter "javascript:getMapExtent()" to the address, press [ENTER], copy (Ctrl-c) the text string from your browser window.
- Go to, tick "Generate srtm2osm command lines." and paste, what you've copied in the last step to the "Bounding Box" field.
- In the ManageMaps.bat under "@echo TOPOGRAPHIC DATA" you need as many "..\..\SRTM2OSM\srtm2osm..." lines as there are "srtm2osm -bounds1 49 5 50 6 -o 53273440.osm" lines at Use the "49 5 50 6 -o 53273440.osm" numbers from and place them to the corresponding lines in the ManageMaps.bat. (If this explanation is too short, you can read an extended explanation at Topographic_maps_for_garmin_devices)
- Save "ManageMaps.bat" and start it with a double click in the explorer. If you have your Garmin connected you can return after some time (that of course depends on the size of the map), and if there is "DONE" at the bottom of the cmd window, you can unplug your device and enjoy the map. Anyway, your map will be placed in MapManager\MAPS\NAME, where "NAME" is the value of the NAME variable in the first line of "ManageMaps.bat".

Part VI: Installing the Map to MapSource

Since a tdb file is generated, you can use MapSetToolKit to install the file to MapSource (which can also be used to upload the map to the Garmin device). If you do not have MapSource, you can download it from Garmin, unzip the self-extracting file manually, install the .msi and then the setup.exe file. To start MapSource, you need to have a map installed first.

Problems / Issues

  • RAM problems at zoom level 9 or smaller.
  • The map data server only allows 1,000,000 queueries in a row. If the selected map viewport contains more data, the first groundtruth command (to download the data) will result in a large, but not sufficient OSM data file ending with the line "<error>Query limit of 1,000,000 elements reached</error>". This of course will provoke fatal problems in the subsequent process.
  • Routing takes some time, clicking "Go" in Oregon 300' routing, results in "No street near destination", even if the route has already been found.
  • 3d view and shading do not work in the Garmin device. (Maybe original Garmin maps store height information differently?)
  • If GroundTruth crashes during download, redirect the console output to a file by ammending "> gt_output.txt" to the groundtruth line in managemaps.bat. Don't know why, but it seems to help.
  • Routing for vehicles and bikes seems to be roughly correct. But routing for pedestrians is a lot more similar to vehicles than bikes and runs over highways.