Routable garmin maps using mkgmap

Hello,

routing support in mkgmap has improved enough that I now have a sort of usable routable map of Berlin on my Vista HCx. Routing is not always ideal, and there’s some crashes in MapSource, but things seem good enough that this might be interesting to try. Some more testing and feedback would be very useful.

I’ve written down some instructions for this on the wiki: http://wiki.openstreetmap.org/wiki/Mkgmap/routing. Note that you currently need to go through polish format, using e.g. osm2mp.

Cheers
Robert

That’s awsome, just in time to match my verbal claims to others that: ‘OpenStreetMap will have opensource routable Garmin maps for the end of 2008’. Just awsome!

there is some others eg radomir, but no published instructions etc…

The big advantage of Mkgmap is that everyone can use it and the source is available. The routable maps published by others are created with private or closed sourced (commercial) software: cGPSmapper.

I’m getting an error - anyone else have this problem?

C:>java -jar mkgmap.jar --route miami.mp
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 2
at uk.me.parabola.mkgmap.reader.polish.RoadHelper.addNode(RoadHelper.jav
a:93)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.line(PolishMa
pDataSource.java:279)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.processLine(P
olishMapDataSource.java:218)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.load(PolishMa
pDataSource.java:97)
at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:128)
at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:44)
at uk.me.parabola.mkgmap.main.Main.processFilename(Main.java:148)
at uk.me.parabola.mkgmap.CommandArgs$Filename.processArg(CommandArgs.jav
a:359)
at uk.me.parabola.mkgmap.CommandArgs.readArgs(CommandArgs.java:118)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:90)

Without looking at the Mkgmap manual or wiki page: The error indicates to me that you are providing not enough parameters…

It looks like your .mp-file contains a malformed (to mkgmap) node line. It expects these to be of the form

Nodx=i,nid,bd

where x just counts through the nodes in a road, i is the node’s index into the coordinates in the road, nid is the node’s ID, and bd is 0 or 1 depending on whether this is a node on the edge of the map. For example

Nod1=3,240,0

It appears that the bd is missing in your map.

Where’s your .mp from? Maybe it’s legal to leave off the boundary field if it’s zero?

Cheers
Robert

SVN should now accept lines like

Nodx=i,nid

also (r808).

Cheers
Robert

Where can I find the latest build of routable Mkgmap?

I’m using r806 with GPSmapedit, and, although the map I made routes, it doesn’t do it very well.
For example, I have to be 500 meters past the “find” waypoint on my 60CSX before it recalculates. Also it doesn’t detect road intersections although it does route across multiple hiking trails.

I’ve noticed that the IMG file that Mkgmap creates loses some of the information in the MP file it compiles from. The MP file has “Transparent=Y” (to create a transparent map) and the MG checkbox is checked (to detect intersections), but the compiled IMG file viewed in GPSMapedit shoes “Transparent=N” and the MG checkbox is unchecked.

Are transparent maps and intersection detection supported?

Thanks in advance.

http://wiki.openstreetmap.org/wiki/Mkgmap/routing

http://wiki.openstreetmap.org/wiki/Talk:Mkgmap/routing#The_.27tolerance.27_setting_for_following_the_expected_route

http://wiki.openstreetmap.org/wiki/Talk:Mkgmap/routing#Where_do_I_find_the_latest_routeable_version_of_Mkgmap.3F

Has something changed with latest (859) version of mkgmap? When running mkgmap I get:

Umlauts in the map are still UTF-8 format, not converted to latin-1 though the commandline switch --utf8 is used.

looks like the wiki needs updating as alot of the new args for mkgmap are missing
I got the latest from --help
as there seems to be no documentation on some of these

Yeah, I tried to document what I knew but I’m surprised as well that there are so many other options. I guess that’s what you get when you never try the --help option :slight_smile:

I guess I can dump the help output to the wiki,
but I didn’t want to step on someones work… other wise ideally the author could update?

The wiki is our work. If you look at the history you will see there are more people contributing, so please go ahead and document what you know.

Question about the “–transparent” argument for mkgmap:
If included as shown above (without the quotes) it doesn’t generate a transparent map.
Is it working? “–transparent=y” didn’t work for me either.
Thanks,

Have you upgraded to the latest Mkgmap? On the wiki page it says something has changed regarding transparency with the latest versions.

When I try to convert mp to img following error display. How can I convert this file?

"E:\Mapmanager\MKGMap>java -jar -Xmx384m -enableassertions mkgmap.jar --route --l
atin1 94220002.mp
SEVERE (Main): java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutO
fBoundsException: -5
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsExceptio
n: -5
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:289)
at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.ja
va:123)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:100)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -5
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.extractResolu
tion(PolishMapDataSource.java:458)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.setResolution
(PolishMapDataSource.java:424)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.line(PolishMa
pDataSource.java:288)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.processLine(P
olishMapDataSource.java:234)
at uk.me.parabola.mkgmap.reader.polish.PolishMapDataSource.load(PolishMa
pDataSource.java:115)
at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:148)
at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:56)
at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:168)
at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:166)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

rgds, Shyamal

Hello, it is difficult to tell without seeing the .mp file, is it possible to
download it from anywhere? Also what version are you using? It appears to be
an older version of mkgmap, perhaps the problem has been fixed in the latest version.

…Steve

I have succeeded in generating very nice routable Garmin IMG files for Central Asia with mkgmap. When I try to use the same style sheets, only slightly modified, for Russia, neither BaseCamp nor my Garmin nuvi GPS can find street addresses, and streets (highway=*) are identified in BaseCamp as airport runways. Has anyone else faced a similar problem, and does anyone have any thoughts on how I should troubleshoot this?