Working on the assumption that the trail covers most of the country, you need to do the following things (a lot of this follows OSM on Garmin Cycle Map):
- Download an OSM XML file containing the area of interest. Usually Geofabrik's download site is the best place to start (some alternatives are listed at the end).
- Download the java program Mkgmap from here.
- Place the OSM XML file & mkgmap in the same directory. (I usually have a specific directory for garmin work).
- Create a subdirectory of that directory called, say,
ncnstyle
. This will be used to store the rules for processing the xml to a garmin img file
- Download a cycle specific mkgmap style from http://svn.openstreetmap.org/applications/utils/export/garmincyclemap/network/cyclemap/ and place them in the subdirectory. You need all the files from this site (info, lines, options, points, polygons, relations, version). Either save by right clicking in your browser or use svn to get all at once. In windows you may need to open each file with the command line editor and save them to change newlines to windows end of lines.
At this point you have everything you need to create a garmin IMG file, but first we want to change things a little so that only the National Cycle Trail data are processed. There are several options for doing this (by filtering out unneeded data from the OSM file), but here I follow a route where we only process NCN data in the mkgmap style.
Once the style has been changed we now need to use it. The way I do this is as follows
- Create a batch file (.bat on windows, a shell script under unix). I only do this because I forget all the parameters and it's easier to change than remember the parameters. Enter on one line the following text (replace things IN UPPER CASE with your particular file names) and save it.
java -jar .\mkgmap.jar -c NCNCYCLE.txt OSMDOWNLOADFILE
- Now create the file NCNCYCLE.txt (again use whatever name you want instead of NCNCYCLE). Here all the mkgmap parameters can be set. The ones I standardly use are as follows:
style-file: ncncycle
family-id: 9201
family-name: YOURNAME
series-name: YOURNAME
tdbfile
route
lower-case
transparent
overview-mapname: ncn-test
overview-mapnumber: 92010000
mapname: mapname: 92010001
keep-going
The 9201 is used because this is unlikely to clash with any other Garmin maps you have, but it is as well to check beforehand. Further details on these options at mkgmap on the wiki.
Now we edit the style files copied earlier. Because we only want the NCN route and we do not want buildings, POIs, forests etc., replace the two following files with an empty file: points, polygons.
Add the following line to the lines file near the top,
> # ----- Downgrade tracks where bicycles are banned
> # (ignore motorway/trunk as this'll look stupid)
>
> bicycle=no & ( highway!=motorway &
> highway!=trunk ) { set
> highway=footway; } access=private {
> set highway=private; }
> ###==== these are the extra three lines, the aim is to suppress all
> output except ncn ==== ### ncn_ref=*
> {add ncn=yes; } (ncn!=yes & highway=*)
> { set ncn=no; } (ncn=no & highway =*)
> {delete highway; delete lcn; delete
> rcn; delete lcn_ref; delete rcn_ref;}
Now run the batch file. It should create 3 files a .tdb and 2 *.img files.
... this answer is incomplete because I'm going to the pub. It should say something about MapSetToolkit. It could do with being edited too.
answered
17 May '13, 20:45
SK53 ♦
28.1k●48●268●433
accept rate:
22%