Show trail marking on Garmin maps

I try to generate a hiking map for Garmin from OSM. I’d like to show the trail markings on the map like these:
I know it’s possible, because on they did it. But how? I understand the styling rules and I know how to modify the TYP file on a basic level, but how to put the trailing marks on the map?
I think I have to put the shields in the TYP file and I have to use actions like {name '${ref|highway-symbol:box}, but exactly how?

Mkgmap reads the ref=?? field and puts it within those boxes, it doesn’t use the TYP file.
I dont think you can put let’s say a blue triangle within that box.

You have to try to set it in the style files, in particular the relation style.

For example in my bicycle map I defined a nref value for all roads with route=ncn.

In the relation style file it can look like this:

type=route & route=bicycle & network=ncn
apply {
set ncn_from_relation=yes;
set nname=‘${name}’;
set nref=‘$(nref)/${ref}’ | ‘${ref}’;

In the line style file all roads that are part of the relation with “type=route & route=bicycle & network=ncn”
gets the tags nref=x and ncn_from_relation=yes

to put a shield with symbol x on those roads, you can add a line like this in the line style:

ncn_from_relation=yes {name '${nref|highway-symbol:oval}

If you dont want the nref value within the highway shield, but another symbol maybe you can try to introduce a value like symbol=‘*’ or some other ascii code?

ncn_from_relation=yes {add symbol=‘*’ ; name ‘${symbol|highway-symbol:oval}’}

It depends on your Garmin if it will be visible, I noticed the highway shields only display where the streets have no name.

See more on
or search for highway shields in the archive:

Thanks Ligfietser, I can display the trail mark references in shields already, but I need the trail marks. I think these guys at OMP just developed mkgmap a bit further and the shields are hardcoded somewhere. OMP displays the trail marks even on streets that have names. My next question is: where are these shields hardcoded: in mkgmap, in cgpMapper or in the GPSr or MapSource?

They use cgpsmapper for compiling the maps. I had a quick look on their maps, it’s not so complicated.
Those trailmarks are just a bunch of pois, and they have made a transparent maplayer for them so you can put that on top of the maps.

So basically you need some tools to convert the trails into a few pois at a regular interval and merge them later with the osm map. You could do this with mapsource, import the trails as gpx file, filter them out and make pois from the gpx file (dont know how). Import those pois in JOSM and save them in osm format in order to make a garmin img with mkgmap.

Wow, thanks. I can parse the osm files for relations and their ways, because it’s a simple xml file, and add POIs. The problem is, that on the various resolutions the trail marks should be on different position. How to tell mkgmap, which POIs to use on which level? Well, I could assign every POI to just one resolution, but that would make a lot of POIs. Or just paint a few POI at the lowest resolution and add some at every level.

I see one relation as one long gpx track. I’d suggest to filter those tracks out for every level you want to create.
Let’s say for level 24 you will get a track with 100 nodes/pois.
For level 22 50 nodes, level 20 25 nodes etc.
You can give those nodes a number and tagnames where they belong to, number=2400-2499, 2200-2249, 2000-2024, trailmark=x
In the pois style, you can set
trailmark=x & number>=2400 [0x9f03 resolution 24]
trailmark=x & number>=2200 & number<2250 [0x9f03 resolution 22]
trailmark=x & number>=2000 & number<2025 [0x9f03 resolution 20]

And in the typ file you give type 0x9f03 a shape that represent trailmark x
For traillmark Y you use garmin type 0x9f04 etc
dont know if 0x9f03 exists but you get the idea.

OK, I tried to put manually POIs in the OSM file and used the following rules (after I solved a few other problems):
osmc:symbol=blue:white:blue_bar & res=20 {name ‘OKT1’} [0x9f03 resolution 20]
osmc:symbol=blue:white:blue_bar & res=15 {name ‘OKT2’} [0x9f03 resolution 15]
osmc:symbol=blue:white:blue_bar & res=10 {name ‘OKT3’} [0x9f03 resolution 10]

Now, the trail marks and the right temporary names appear on the map, but on every resolution, even on 3000km in Mapsource. So I think the tag tests and the action blocks are OK, but the element type definition (the resolution) is wrong. Or the level of each of my POIs are determined somewhere else. What I did wrong?

You should use different resolutions, 15 and 10 are way too low.
And I think Garmin type 9f03 is not good. Could be that it is not supported by Garmin.
Try another one, like 0x2800 0x2801 0x2803 etc

This is what mkgmap says about the resolution:

The first is ‘resolution’ this is a number between 1 and 24 with 24 being

the most detailed resolution and each number less is half as detailed.
So for example if a road was 12 units long at resolution 24 it would be
only 6 at resolution 23 and just 3 at resolution 22.

On a Legend Cx the resolution corresponds the these scales on the device:

16 30km-12km
18 8km-3km
20 2km-800m
22 500m-200m
23 300m-80m
24 120m-50m

Thanks, all is clear now. I just noticed that MapSource has a separate details dropdown list and it was on highest details of course.