logo separator

[mkgmap-dev] Re: Code for Highway Symbols

From Toby Speight T.M.Speight.90 at cantab.net on Tue Apr 14 13:28:21 BST 2009

Sorry about the silence - I've just been away for a long weekend
away from email.


0> In article <4dda9d8f0904090731s1e7647ebi7e1749c11cda7e93 at mail.gmail.com>,
0> Clinton Gladstone <URL:mailto:clinton.gladstone at googlemail.com> ("Clinton") wrote:

Clinton> Yes, I tried out the subst filter, but I liked regex approach
Clinton> for two reasons:
Clinton>
Clinton> 1. I can filter out unreasonable values for the highway
Clinton>    signs.  In such cases, I can remove the prefix code, so no
Clinton>    sign will be displayed.
Clinton>
Clinton> 2. I can perform more complex pattern matchING to remove spaces.
Clinton>
Clinton> Without the regex and using the subst rule, I get a number of roads
Clinton> that have improper symbols.  See the attached screen shot for an
Clinton> example.

Oh - are those really valid 'ref' values?

I see what you mean, and I think the right way is probably to upgrade
my simple 'subst' filter to handle regexps.  Do you think that that
would be the best solution?

As I wrote:

>> Would it be useful to have some sort of regular expression filter?
>>  I could code that up quickly enough, and it's probably cleaner
>> than having magic in Element.java.

Clinton> This could be interesting, but is it practical? I personally
Clinton> like regexes, but I'm not sure if this would find wider use.
Clinton> Would it be possible to easily include regexes in the style
Clinton> file, which are similar to the regexes I use in my patch?

That's what I was thinking of.  The syntax would look something like

#> highway=motorway {name '${ref|subst:^[\([AM]\) ?\([0-9]+\)$=>\1\2|prefix:boxx} ${name}'

(for British and German motorways; it would need a little more
knowledge to cover more 'ref' values.


>> I'd appreciate suggestions for better mnemonics for the magic
>> characters; also if anyone knows how to code the 6-bit switch, I'd
>> like some clues as to to how to find what encoding we're writing.

Clinton> I'll look into both of these. I found the coding for the 6/8
Clinton> bit encoding the other day. I'll if I can locate it again.

I'm thinking that our best approach is going to be to use a single
Java 'char' value in the action, then make the encoding translate that
on output - I'll try and find time for that this week (if it rains!).


Clinton> I also like what you have done for the "natural=peak" POI. (Is
Clinton> it worth doing the same for natural=volcano?)

I didn't spot the volcano one (and we don't have any near me).  Sounds
like a good idea.



More information about the mkgmap-dev mailing list