logo separator

[mkgmap-dev] multiple US highway shields on one highway

From Ben Konrath ben at bagu.org on Sun May 31 18:39:46 BST 2015

Hi everyone,

I recently added the US highway shields to my maps. My solution works
pretty well and I'll happily make a patch for the default style if people
are interested. Here's what I'm currently doing:

# Highway shields for the United States.
# All highways in the US that aren't link roads and have a reference in the
expected format.
mkgmap:admin_level2=USA & highway=* & highway~'^(?!.*_link).*$' &
ref~'^[A-Z]+(-| )*\d+$'
  { set usa_hwy_ref_numbers='${ref|subst:"^([A-Z]+)(-| )*(\d+)~>$3"}'; set
usa_hwy_ref_letters='${ref|subst:"^([A-Z]+)(-| )*(\d+)~>$1"}' }

usa_hwy_ref_letters=I
  { name  '${usa_hwy_ref_numbers|highway-symbol:interstate} ${name}' |
'${usa_hwy_ref_numbers|highway-symbol:interstate}'; addlabel '${name}' }

usa_hwy_ref_letters=US
  { name '${usa_hwy_ref_numbers|highway-symbol:shield} ${name}' |
'${usa_hwy_ref_numbers|highway-symbol:shield}'; addlabel '${name}' }

# State highways are prefixed in OSM with SR or the state code.
usa_hwy_ref_letters~'SR|AL|AK|AZ|AR|CA|CO|CT|DE|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|M|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY'
  { name '${usa_hwy_ref_numbers|highway-symbol:round} ${name}' |
'${usa_hwy_ref_numbers|highway-symbol:round}'; addlabel '${name}' }

One issue I have is that I haven't figured out a way to support multiple
highway shields for roads that have multiple interstate, us highway or
state highway references. For example, this section of highway has the ref
tag set to "I 275;I 96" meaning that it's both interstate I275 and
interstate I96.

http://www.openstreetmap.org/way/124433753

I tried setting the highway-symbol filter twice on one highway but it
didn't work. It this expected work or does the garmin format only allow one
shield per highway? Does anybody have any ideas on how I could get multiple
highway shields to display when a highway is part of multiple highway
references?

Thanks, Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150531/ba5f2abe/attachment.html>


More information about the mkgmap-dev mailing list