OpenStreetMap

Mark Pokorny's Diary Comments

Diary Comments added by Mark Pokorny

Post When Comment
First Submission

Hi DeBigC! Yes, I am based in Ireland at the moment. Mark.

OSM on Garmin

Hi Marco, glad it works for you!

I think the OSM server automatically uploads the entire content of any ways or areas that cross the edges of the boxes you want to download. This means that if you download two adjacent boxes, any items that cross the boundary between the two boxes will be duplicated, causing the overlap.

As you're using two adjacent boxes, you should be able to use:

perl osmget.pl "13,48,14,50" > map_name.osm

to get the area you wish. osmget.pl will automatically break it up into smaller bits in order to retrieve them from the server, and then recombine them when they arrive at your computer into a single file (in this case, 'map_name.osm'). This should stop any duplication.

If you already have the boxes downloaded (no doubt you probably have), then you might be able to use the osmsort.pl tool to eliminate any duplicated ways. I'm not sure if that'll work, but you can give it a go to see.

I hope that helps a little. If not, let me know and I'll do a little bit more investigating.

Regards,

Mark.

OSM on Garmin

Hmm, I thought I could edit my own comments, but it looks like I can't…I'll get the hang of this yet!

OSM on Garmin

Thanks skela! I'll edit the post with your suggestion now!

OSM on Garmin

I promised that I would try and explain what I did if someone asked, and, well, maning did! They asked about running the whole thing in a bash script, so here we go:

I use Linux, so this applies primarily to users of Linux distributions. This will probably work on Mac and/or Windows too, but I have no way of testing them.

There are some prerequisites that are needed. You will need to get the following packages from your repositories. These are:

ant
perl
subversion
java

How to get these packages will depend on your linux distribution. You will then need the latest subversion for Liosha's 'osm2mp' tools, and the routing version for 'mkgmap' (I ended up using the latest subversion for this too). You can get these by doing:

svn co http://osm2mp.googlecode.com/svn/trunk/osm2mp osm2mp
svn co http://svn.parabola.me.uk/mkgmap/branches/nod mkgmap-nod
cd mkgmap-nod
ant dist

from your command line (you might want to do this in a new directory so that you can keep track of everything). These only need to be done once, so there's probably no point in putting them in the script. Once these steps are done, you can then build your script, which should be in the following format:

---------------------------
#!/bin/bash

cd [PATH_TO_WORKING_DIRECTORY]/osm2mp

perl osmget.pl "[BOUNDING BOX COÖRDINATES]" > ../map1.osm
# … do this for as many regions as you want

perl osmsort.pl ../*.osm > ../map_complete.osm

perl osm2mp.pl --nocodepage ../map_complete.osm > ../map_complete.mp

cd ../

java -jar mkgmap-nod/dist/mkgmap.jar --latin1 --route --gmapsupp map_complete.mp
---------------------------

Where [BOUNDING BOX COÖRDINATES] are the coördinates of the region you want to download (West, South, East, North); for example:

perl osmget.pl "-6.424,53.233,-6.017,53.426" > ../dublin.osm

will get you most of the city of Dublin. You can specify a box as large or as small as you wish; osmget.pl will automatically split it into smaller sections for the server to handle if necessary, and then recombine them once they have been downloaded. You can also change the names of the files in the script as you see fit.

If you have a problem with the 'java' command throwing an exception, the chances are that it ran out of memory. You can increase the amount of memory assigned to the 'java' command by adding -Xmx512m (or whatever value you wish to assign - make sure you actually have the amount you specify before doing so!) after the word 'java'. You can also use option --charset="[NAME]" instead of --latin1 if you are generating maps for a region that does not use the latin script; [NAME] in this case should be an encoding that covers the region you are doing (for example, koi8r for Russian Cyrillic).

This process will generate the gmapsupp.img file that you need to put onto your Garmin to make use of the routable maps. I strongly suggest you back up everything on your Garmin's memory before doing so!

First Submission

Thank you! I can imagine! Already I'm anxious to get on with the next bit, but I have to keep telling myself that I have to be patient and learn how to do things first!