highway shields in label occasionally dropped

Hi, I found that at some of the ways (which have a filled REF-field) the highway-symbol is dropped and only the content of "REF" is shown. some examples(i used r1344). I write "_" instead of "real" spaces just to make it easier to read: if "B" is given the result is "B" "B1" instead results in "~[0x06]B1" (where ~[0x06] represents the highway shield) "_B_" surprisingly ends up in "~[0x06]_B_" "BW" results in "BW" "BW1" results in "BW1" "B_W1" results in "~[0x06]BW1" "BW;1 " results in "~[0x06]BW;1" "BW_1" results in "~[0x06]BW1" (ok, afaik intermediate spaces has to be removed, otherwise only the first part is visible in highway shield) I (like also people do in OSM database i saw) use the REF in combination with the highway shield also as marker for trails (in hiking/biking overlays) and therefore this behaviour disturbs. I have looked in the code and found in the HighwaySymbolFilter.java this "alpha_balance" which is the reason for. Simply changing "return value" to "return prefix + value" stops this. Looking at the examples, the results of the filter is a bit strange to me. I can't get the intention. Do we really need this filter ? cheers Gert

On Wed, Nov 4, 2009 at 11:51 AM, Gert Münzel <Gert.Muenzel@netcologne.de> wrote:
I have looked in the code and found in the HighwaySymbolFilter.java this "alpha_balance" which is the reason for. Simply changing "return value" to "return prefix + value" stops this.
Looking at the examples, the results of the filter is a bit strange to me. I can't get the intention. Do we really need this filter ?
I believe there are two purposes to this filter: 1. To filter out values which would be implausible for a highway shield. That is, some refs look like "Autostrada del Sole", which would result in a shield displaying just "Autostrada", which isn't really desirable. 2. To remove spaces from plausible refs. As you noted above, intermediate spaces have to be removed from refs such as "B 1", as only "B" would be displayed in the shield. That said, the filter algorithm could certainly be improved. If I have time this week, I might try taking a few hacks at it. You could do the same, if this would amuse you. ;-) Cheers.

2009/11/4 Gert Münzel <Gert.Muenzel@netcologne.de>
I (like also people do in OSM database i saw) use the REF in combination with the highway shield also as marker for trails (in hiking/biking overlays) and therefore this behaviour disturbs.
Hi Gert! I tried the same yesterday to generate a hiking route overlay for my garmin topo map (as I currently like to go hiking and add new routes here in western Germany) and also noticed that only very few routes show highway shields at all (mostly when they have very simple refs like "1" or "2"). How do you deal with the problem of ways that are part of multiple routes? I would like to generate one line element for every route=hiking/foot relation that a way belongs to, but can't figure out how to do this. Currently, only one route is displayed for each segment. Will it work with [continue]? Extract every relation and its ways and nodes to a seperate .osm file using Osmosis (how?) and then process them all with mkgmap? Thanks! -Martin

Martin wrotes on /Wed Nov 4 16:44:01 GMT 2009 /Hi, Martin, I'm sorry but i just startet with the osm-Data-styling-stuff. Before i used only mp-format input. So, actually i can't really help you./ /
I tried the same yesterday to generate a hiking route overlay for my garmin topo map (as I currently like to go hiking and add new routes here in western Germany) and also noticed that only very few routes show highway shields at all (mostly when they have very simple refs like "1" or "2").
It's possible that some are filtered by the Filter in HighwaySymbolFilter.java. Eg. for single chars like "K" the shield will be dropped. Simply change in this "alpha_balance" part "return value" to "return prefix + value". Then prefix dropping stops. But this may cause some other trouble as Clinton explained. Java also is totally new for me, but if i need some amusement, like Clinton said, may be i will try to understand and enhance these part of the filter. Actually i prefer having a cool beer in the pub.
How do you deal with the problem of ways that are part of multiple routes? I would like to generate one line element for every route=hiking/foot relation that a way belongs to, but can't figure out how to do this. Currently, only one route is displayed for each segment. Will it work with [continue]? Extract every relation and its ways and nodes to a seperate .osm file using Osmosis (how?) and then process them all with mkgmap? If two trails like e.g. X11 and X30 shares some ways, then it would be enough if only an "X" is set for the shared parts. So you have to check for each segement if its also part of another relation and then create an special label which is then in the REF part equal for both. As i told above, am'i a newbie to this style stuff and can't give you the information if its possible or even how to realize it. May be these continue-patch can help.By the way: is it still only in the style-branch or also in the trunk?
cheers Gert

On Nov 4, 2009, at 11:51, Gert Münzel wrote:
I found that at some of the ways (which have a filled REF-field) the highway-symbol is dropped and only the content of "REF" is shown. some examples(i used r1344). I write "_" instead of "real" spaces just to make it easier to read: if "B" is given the result is "B" "B1" instead results in "~[0x06]B1" (where ~[0x06] represents the highway shield) "_B_" surprisingly ends up in "~[0x06]_B_" "BW" results in "BW" "BW1" results in "BW1" "B_W1" results in "~[0x06]BW1" "BW;1 " results in "~[0x06]BW;1" "BW_1" results in "~[0x06]BW1" (ok, afaik intermediate spaces has to be removed, otherwise only the first part is visible in highway shield)
Try the attached patch. It should resolve these problems. (Of course it could also cause unwanted side-effects.) The patch simply gets rid of the alpha balancing code, removes ALL spaces from the ref, and changes ";" characters to "/" characters. I added the ; to / change, as multiple refs are often thrown together in the one ref and separated by ";" chars, such as "B2;B5". I thought "B2/B5" looks nicer, but this might not be what you want in your "BW; 1" example above. If that's the case, it's easy to remove this too. If the total number of characters in the ref is greater than 8, a shield will still not be added. Cheers

Hi Clinton, your cg-sign-v1.patch works like expected. IMO this should be the default and the alpha_balance in it's actual form should be activated from those who wanna use it. Cases like "Autostrada del Sole" will be handeld by this MAX_REF_LENGTH = 8. The example in the code "A6144(M)" already busts the shield on my Gmap 60cx and clutters up the display. So i don't believe that somebody wants something like "Autostrada del Sole" in a shield. cheers Gert

2009/11/5 Gert Münzel <Gert.Muenzel@netcologne.de>:
The example in the code "A6144(M)" already busts the shield on my Gmap 60cx and clutters up the display.
Luckily the A6144(M) is no longer so-numbered. It's now simply the A6144. Dermot -- -------------------------------------- Iren sind menschlich

On Thu, Nov 5, 2009 at 5:14 PM, Dermot McNally <dermotm@gmail.com> wrote:
2009/11/5 Gert Münzel <Gert.Muenzel@netcologne.de>:
The example in the code "A6144(M)" already busts the shield on my Gmap 60cx and clutters up the display.
Luckily the A6144(M) is no longer so-numbered. It's now simply the A6144.
Perhaps it would be an idea to lower the limit for shields to 5 characters, after spaces have been removed? (And potentially 3 if no numeric characters are present?) Cheers.

On Thu, Nov 5, 2009 at 5:39 PM, Nakor <nakor.wp@gmail.com> wrote:
Perhaps it would be an idea to lower the limit for shields to 5 characters, after spaces have been removed?
This will cause problems here in the US with routes like BUS US-127
Can this be reasonably displayed in a highway shield? Since spaces have to be removed, this would wind up looking like [BUSUS-127]. Or have I misunderstood? Cheers

*From* Clinton Gladstone *on* /Thu Nov 5 16:45:10 GMT 2009/
On Thu, Nov 5, 2009 at 5:39 PM, Nakor wrote: / />/ Perhaps it would be an idea to lower the limit for shields to 5 />/ characters, after spaces have been removed? /> / />/ This will cause problems here in the US with routes like BUS US-127 /
Can this be reasonably displayed in a highway shield? Since spaces have to be removed, this would wind up looking like [BUSUS-127]. Or have I misunderstood? No, you didn't. As i told already the example //A6144(M)// given in the filter code busts the shield on my 60csx , so that it's not looking nice. (maybe thats depending on the device you have). "A6144(M)" is the max. length i saw in an original garmin map of europe.
Depending on the letter you use ( they needs different space for displaying) i would say 6-8 sign are really enough. More you not want have as it really clutters up the display. The idea of reducing it to 5 signs isn't good as there exist e.g in Italy shields like "S45BIS", "A26DIR" or "ST2018a" in Germany. or "D763 B1" in France. And reducing it to 3 sign in the case if no numeric is present doesn't bring any benefit and e.g. may constrain those who use it for marking hiking trails and other stuff. The "BUS US-127" is simply to long for displaying it in a highway shield on GPS. Isn't there a way dealing with this via stylefile?. e.g looking up the content of REF and checking if there is a "BUS " at the beginning and then cutting of this "BUS " so that only "US-127" remains which then is displayable ? Just an idea of a poor man having less experience with style files. cheers

On Thu, Nov 5, 2009 at 7:04 PM, Gert Münzel <Gert.Muenzel@netcologne.de> wrote:
The "BUS US-127" is simply to long for displaying it in a highway shield on GPS. Isn't there a way dealing with this via stylefile?. e.g looking up the content of REF and checking if there is a "BUS " at the beginning and then cutting of this "BUS " so that only "US-127" remains which then is displayable ? Just an idea of a poor man having less experience with style files.
At the moment, this is not possible. I believe we did have some discussion about allowing regular expressions in the style files, but the approach and necessary syntax seemed somewhat unwieldy. Also, in this example, I think the "BUS" in "BUS US-127" stands for "Business Loop", which is distinct from the main "US-127", so dropping the "BUS" could be potentially misleading. We certainly seem to have a problem, because it is hard to determine exactly what is reasonable to display in the highway shields. This can be quite subjective too. Right now with the code, I am getting things like "Südring" appearing as shields, which doesn't really seem right. (This is why I thought about lowering the limit for alpha-only strings.) Let's do some more thinking about a flexible solution. Cheers.

Clinton Gladstone wrote:
On Thu, Nov 5, 2009 at 7:04 PM, Gert Münzel <Gert.Muenzel@netcologne.de> wrote:
The "BUS US-127" is simply to long for displaying it in a highway shield on GPS. Isn't there a way dealing with this via stylefile?. e.g looking up the content of REF and checking if there is a "BUS " at the beginning and then cutting of this "BUS " so that only "US-127" remains which then is displayable ? Just an idea of a poor man having less experience with style files.
At the moment, this is not possible. I believe we did have some discussion about allowing regular expressions in the style files, but the approach and necessary syntax seemed somewhat unwieldy.
Also, in this example, I think the "BUS" in "BUS US-127" stands for "Business Loop", which is distinct from the main "US-127", so dropping the "BUS" could be potentially misleading.
We certainly seem to have a problem, because it is hard to determine exactly what is reasonable to display in the highway shields. This can be quite subjective too. Right now with the code, I am getting things like "Südring" appearing as shields, which doesn't really seem right. (This is why I thought about lowering the limit for alpha-only strings.)
Let's do some more thinking about a flexible solution.
Cheers.
I think we need a special file where one can exclude words foremost (besides of course in-built removal on non-displayable characters, spaces,...) Of people put things like "bicycle route 34" into the ref, so there would be the need for a file where one can define words to be dropped (i.e. "bicycle route"). The same filter would be nice for names (e.g. checking after applying the style-file whether no words are two times inside the name - often where well known routes are passing, streets / ways simpy get the name of the route (be it official, local name for that street, or because mapper thinks better some name than none...) So if you add the route name to the name of the street you get things like "Donauradweg Donauradweg Noe section 5) (but section 5 will be in reference too) or ref that is added to a relation as ref="" but also already inside the name as "name (ref)" . So a) ref should be reduced for the highway shield, b) ref should be added to name (if specified in style-file) but a check should be carried out that no duplicate information is entered.
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (6)
-
Clinton Gladstone
-
Dermot McNally
-
Felix Hartmann
-
Gert Münzel
-
Martin Simon
-
Nakor