First off, I am more than impressed with the work that has gone into OpenStreetMap, mkgmap, and the community contributed content that opens up the Garmin devices to better maps and customizable options! THANK YOU all! I purchased a Garmin Zumo XT motorcycle GPS to use when I am riding my Triumph Scrambler in my state, and I was hoping I could highlight the unpaved roads on the map so I can explore these roads. I also want to contribute the surface type for roads in my area that are incorrect on OpenStreetMap so others can benefit.
Based on information on this site and others, I was able to create a custom IMG file using mkgmap and a modified style that assigns a Garmin type code to unpaved roads. There are two types of unpaved roads that I want to highlight, roads that are unclassified or residential which are typically wide and allow for 2-way traffic, and tracks which are typically narrow and in my experience can indicate a rough road that may be more difficult to ride on. I added this to my lines style:
# highlight unpaved roads that are more than 100m
(highway!=track & highway!=service) &
(access!=private & access!=no) &
(motor_vehicle!=no) &
(surface=gravel | surface=dirt | surface=unpaved | surface=unsurfaced | surface=ground | surface=earth | surface=compacted | surface=fine_gravel) &
length()>100
{set mkgmap:unpaved=1} [0x0a resolution 20]
# highlight unpaved tracks that are more than 100m
(highway=track | highway=service) &
(access!=private & access!=no) &
(motor_vehicle!=no) &
(surface=gravel | surface=dirt | surface=unpaved | surface=unsurfaced | surface=ground | surface=earth | surface=compacted | surface=fine_gravel) &
length()>100
{set mkgmap:unpaved=1} [0x0e resolution 20]
So far this is working the way I want it to, you can see I am using the Garmin Type Code 0x0a for the unpaved roads and 0x0e for tracks. I want to show them in 2 different custom colors to make them stand out on the map. I added a section to the mapnik.txt TYP file to make 0x0e stand out in bright red, but it doesn’t seem to be working.
[_line]
type=0x0e
;GRMN_TYPE: Custom routable road 2
UseOrientation=N
LineWidth=7
BorderWidth=1
Xpm="0 0 2 0"
"1 c #FF0000"
"2 c #FFFFFF"
String=MADVTrail
ExtendedLabels=Y
FontStyle=SmallFont
CustomColor=Day
DaycustomColor:#FF0000
[end]
I am compiling the IMG file using the command:
java -jar mkgmap.jar -c zumoxt.cfg --input-file=input/map.osm --output-dir=output/ --family-id=1234 typ-files/mapnik.txt
I think the issue is with the way the Zumo XT deals with these elements. I can modify a Garmin style file (xml based .kmtf file) to customize the look of differing lines, but this file doesn’t seem to line up 1:1 with the Garmin Type Codes, especially for a “Custom routable road”. This is what a section of my .ktmf file looks like:
<!-- blue unpaved roads that are publicly accessible -->
<STYLE field="MAP_ROAD_UNPAVED_CLR" scale="1.50"><COLOR><PRIMARY day="#3841fc" night="#3841fc"/><SECONDARY day="#3841fc" night="#3841fc"/></COLOR></STYLE>
From what I can tell, the field MAP_ROAD_UNPAVED_CLR is equivalent to the Garmin Type Code 0x0a, since it is showing those roads in a nice blue:
But the Zumo XT is not picking up the custom style from the TYP file for the red tracks that I want, here you can see the lines that are thick gray are supposed to be red based on the TYP file spec:
So, after this long-winded post, my ultimate question is: How can I get my Custom Routable Road (0x0e) to show up in red like I want? Is there a STYLE field in the .ktmf file that I can add to change the color or am I doing something wrong with the custom TYP file? Thanks in advance for the help, I’m so close to having the perfect GPS!