<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Mark,<br><br>with the correct syntax:<br># remove characters a to z and A to Z from ref, e.g. "I 80" -> " 80", "Anna Bob 99 TED" -> " 99 "<br>ref=* {set my_ref='${ref|subst:"[a-zA-Z]*~>"}'}<br>highway=motorway { name '${my_ref|highway-symbol:hbox} ${name}' | '${my_ref|highway-symbol:hbox}' | '${name}' }<br><br>Gerd<br><br><div>> Date: Fri, 2 Jan 2015 21:11:24 -0700<br>> From: gpetermann_muenchen@hotmail.com<br>> To: mkgmap-dev@lists.mkgmap.org.uk<br>> Subject: Re: [mkgmap-dev] How to display highway shields with numbers only<br>> <br>> Hi Mark,<br>> <br>> okay, so your problem is not directly related to the highway symbols.<br>> What you need is a simple filter to return the part of a string which<br>> starts at the first digit. I guess this can be done with subst plus a<br>> regular expression,<br>> but I'm not sure how exactly.<br>> Something like<br>> ref=* {set my_ref = ${ref|subst:"[a-zA-Z]*~>"}<br>> <br>> <br>> Gerd<br>> <br>> <br>> Mark Bradley-2 wrote<br>> > Thanks for responding Gerd. Yes, I experimented with the Substring<br>> > filter,<br>> > just as you suggested. But because the number of characters in the ref<br>> > tag<br>> > varies, I could not figure out how to make it work for all cases. I'll<br>> > keep<br>> > working on it.<br>> > <br>> > Mark<br>> > <br>> > ________________________________________<br>> > <br>> > <br>> > Hi Mark,<br>> > <br>> > this simple change in default/lines seems to work for me (in MapSource): <br>> > <br>> > ref=* {set my_ref='${ref | substring:2}''}<br>> > highway=motorway { name '${my_ref|highway-symbol:hbox} ${name}' |<br>> > '${my_ref|highway-symbol:hbox}' | '${name}' }<br>> > <br>> > Without it I see "A1", with it I see just "1" in the shield.<br>> > There is more to do catch all cases for different types of highways and<br>> > those without a ref.<br>> > <br>> > Gerd<br>> > ________________________________________<br>> > From: <br>> <br>> > ethnicfoodisgreat@<br>> <br>> > To: <br>> <br>> > mkgmap-dev@.org<br>> <br>> > Date: Thu, 1 Jan 2015 08:49:01 -0500<br>> > Subject: [mkgmap-dev] How to display highway shields with numbers only<br>> > Hi list members,<br>> > <br>> > A few weeks ago I proposed the following problem. I did not receive any<br>> > help, so I will ask again, in case any of you can shed some light.<br>> > <br>> > Table 4.4 in the Conversion Style Manual shows highway shields displaying<br>> > numbers only, which is what I would like to achieve. In Table 4.3 (the<br>> > list<br>> > of substitution filters), the description for the highway-symbol filter<br>> > says<br>> > that the filer "Prepares the value as a highway reference such as 'A21'<br>> > 'I-80' and so on. A code is added to the front of the string so that a<br>> > highway shield is displayed, spaces are removed and the text is truncated<br>> > so<br>> > as not to overflow the symbol." The description does not explain (from<br>> > what<br>> > I can tell) how to remove the alphabetic characters, leaving only the<br>> > numbers. I've tried several possibilities of the filter without success.<br>> > Where I live, there's a motorway called Interstate 70 which is labeled<br>> > "I70"<br>> > in OSM. I would like to create shields with only the number in the<br>> > shields,<br>> > similar to the example in Table 4.4. How do I do this?<br>> > <br>> > To add a little more information: The description in Table 4.4 for each<br>> > of<br>> > the first three symbols says "digits only." If I apply the substitution<br>> > filter to the ref values as is, the symbols on the resulting map do NOT<br>> > contain digits only, they also include the alpha characters in front of<br>> > the<br>> > numbers that describe what type of highway the highway is, such as "I" for<br>> > interstate or "SR" for state road. Based on this, I have to conclude that<br>> > it is up to the mapper to strip off these alpha characters first, before<br>> > applying the highway symbol filter. Again, I have tried numerous<br>> > combinations of the style filters and commands without success. The<br>> > problem<br>> > is that the number of alpha characters preceding the digits can vary.<br>> > Sometimes there are no alpha characters at all. I know how to add "dummy"<br>> > spaces to the ref tag for those features that don't have a ref value at<br>> > all,<br>> > but how to strip the alpha characters when the number of characters can<br>> > vary, and the separator character is a space?<br>> > <br>> > I would've thought this would be a common desire for users in the U. S.<br>> > and<br>> > that it would've been solved a long time ago. Maybe not?<br>> > <br>> > Mark<br>> > <br>> > <br>> > _______________________________________________<br>> > mkgmap-dev mailing list<br>> <br>> > mkgmap-dev@.org<br>> <br>> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev<br>> <br>> <br>> <br>> <br>> <br>> --<br>> View this message in context: http://gis.19327.n5.nabble.com/How-to-display-highway-shields-with-numbers-only-tp5828816p5828820.html<br>> Sent from the Mkgmap Development mailing list archive at Nabble.com.<br>> _______________________________________________<br>> mkgmap-dev mailing list<br>> mkgmap-dev@lists.mkgmap.org.uk<br>> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev<br></div>                                            </div></body>
</html>