logo separator

[mkgmap-dev] [PATCH] Display road name instead of ref in routing directions

From Clinton Gladstone clinton.gladstone at googlemail.com on Wed Oct 28 12:01:24 GMT 2009

The attached patch causes road names (instead of refs) to be displayed
in routing directions.

That is, you will get "Turn right onto Weseler Strasse (B58)" instead
of just "Turn right onto B58".

If you use a style other than the default, you will have to add a "add
display_name = '${name} (${ref})'" statement to the appropriate lines
in your style file. Example:

  highway=secondary {name '${ref|highway-symbol:oval} ${name}' |
'${ref|highway-symbol:oval}' | '${name}'; add display_name = '${name}
(${ref})' }

The patch reads the display_name tag according to the style file, and
writes it as a second label. This second label will be used for
routing directions, at least in the case where a highway symbol is
displayed on the map for the road in question.

- In the patch, display_name is set in the style file to "Name (Ref)".
You may adjust this to your liking. It may be expedient to simply
display just the name without the ref in brackets.

Since this may significantly improve routing directions in certain
circumstances, I would appreciate your feedback.


Some additional comments:

- display_name may not be the best name for the style file tag.

- The patch to StyledConverter.java simply prepends the display_name
to the list of references. This takes advantage of the side-effect
that the refs are all written sequentially as additional labels. It
might be a cleaner approach to directly write the display name as a
secondary label, but the patch was a very quick and cheap way of
testing this concept.

- The display_name will also be displayed in Mapsource when you cursor
over the road with the mouse.

Cheers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cg-road-routing-display-v1.patch
Type: application/octet-stream
Size: 2187 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20091028/ec37639d/attachment.obj 


More information about the mkgmap-dev mailing list