logo separator

[mkgmap-dev] [PATCH] Alpha code for Highway Symbols

From Clinton Gladstone clinton.gladstone at googlemail.com on Mon Apr 6 12:26:56 BST 2009

Attached is alpha coding which enables graphical highway symbols in
the map. See the attached screen shot for an idea of how this looks in
mapsource (the symbols A5, B36, etc. now appear on the respective
highways). Display looks similar on my e-trex.

- The patch works only if the label file is written in 8-bit mode (use
option --latin1 with mkgmap).

As I am neither a Java programmer, nor familiar with Garmin's img
format, the code is pretty rough. It consists of two parts:

1. An addition to the lines style file, which inserts the special code
before the highway reference (hex 0x04 for motorways, 0x05 for major
highways, 0x06 for minor highways).

    I had to use a hex editor to insert these symbols.

2. A hack in Element.java, which removes a space if it is the second
character of the highway name.

   This is needed because only characters up to the first space will
be displayed in the graphic symbol. That is, "A 5" would be displayed
as only "A" in the highway symbol, so I change "A 5" to "A5" to get a
reasonable symbol.

   The hack is obviously a poor solution, but it serves as a proof of
concept. A clever regex would be much better here, as it should catch
cases such as "SS 125", etc.


Sorry for the poor quality of the code, but I did not have an Internet
connection when I did this; I could not look up the proper way to do
things in Java (such as regexes, string comparisons, constants, etc.).

I would appreciate your comments. At least the patch makes the map
look cool. ;-)

Cheers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cg-magic-2.patch
Type: application/octet-stream
Size: 2384 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090406/bfcd225b/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: highway-symbols.PNG
Type: image/png
Size: 5473 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090406/bfcd225b/attachment.png 


More information about the mkgmap-dev mailing list