logo separator

[mkgmap-dev] Re: Code for Highway Symbols

From Clinton Gladstone clinton.gladstone at googlemail.com on Thu Apr 9 15:31:42 BST 2009

On Wed, Apr 8, 2009 at 8:42 PM, Toby Speight <T.M.Speight.90 at cantab.net> wrote:
> Your space-removal stuff isn't necessary with my patch: just add a
> 'subst' filter to the value:

Yes, I tried out the subst filter, but I liked regex approach for two reasons:

1. I can filter out unreasonable values for the highway signs. In such
cases, I can remove the prefix code, so no sign will be displayed.

2. I can perform more complex pattern matching to remove spaces.

Without the regex and using the subst rule, I get a number of roads
that have improper symbols. See the attached screen shot for an
example.

> # highway=motorway {name '${ref|subst: =>.|prefix:boxx} ${name}' |
> # '${ref|subst: =>.|prefix:boxx}' | '${name}' }
>
> That replaces each space in ${ref} with a dot; to remove the spaces
> completely, use ${ref|subst: =>} - or, equivalently, ${ref|subst: }.
> Which would be best in the default rule-set?

Hm... based on the results I get, it may be practical to leave this
out of the default rule-set entirely for the time being. This rule
could potentially cause undesirable side effects, and therefore should
remain optional.

> 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.

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

(Certainly the approach of hacking coding into Element.java is not appropriate.)

> Also, I forgot to mention when I posted my patch: 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.

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

And thanks for your work here. The method of adding a non-binary
prefix value in the style file is very helpful. I also like what you
have done for the "natural=peak" POI. (Is it worth doing the same for
natural=volcano?)

Cheers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: highway-long-subst2.png
Type: image/png
Size: 15724 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20090409/83022b34/attachment.png 


More information about the mkgmap-dev mailing list