Style File Problem

I've battled trying to narrow this down for a couple of days. I have a lines style file that contains: highway=* & maxspeed=40mph {set mcssl=40} highway=primary & mcssl=40 [0x04 resolution 19] highway=* & mcssl=40 [0x04 resolution 22] I'm then running a stripped down (in JSOM) set of OSM data against this. The data file contains two roads. The first road is the original, whilst the second is a copy (in JOSM) with a name added (and dragged a bit so it is visible). Both have primary=highway and maxspeed=40mph. To me it seems that as both ways have the same maxspeed and highway attributes they should both become visible at the same resolution (ie. 19). However, they don't. The one without the name becomes visible at 3mi (which I guess is 19), whilst the one with the name becomes visible at 0.5mi (which I guess is 22). It seems therefore that having a name key (or a given value for that key) affects the style file somehow. I've tried to look at the code but have no idea where to start (as my Java knowledge is virtually zero and I don't know how data moves through the mkgmap). Files are attached. Mkgmap version: 1180 (although I've tried a few other recent version other the past few days). mapsource: 6.13.7 Any ideas? # # Style options. # # The name tag determines what tag is used as the name of a # feature. Usually this is just 'name' but you might want something # more specific such as name:en or another language variant. # You can specify a list here, the first one that exists will be # used # # Example: # name_tag = name:en, int_name, name # The levels specification for this style # #levels = 0:23, 1:22, 2:21, 3:20, 4:19, 5:18, 6:16, 7:12 #levels = 0:24, 1:22, 2:21, 3:20, 4:19, 5:18, 6:16, 7:12 levels = 0:22, 1:19, 2:18, 3:16 #Don't forget we need a blank line at the end or Java crashes highway=* & maxspeed=40mph {set mcssl=40} highway=primary & mcssl=40 [0x04 resolution 19] highway=* & mcssl=40 [0x04 resolution 22]

Mapsource only uses even resolution. Only gps uses uneven. So as you did not set 20, that might be the reason to go straight up to 22. Try with even resolution only. MarkS wrote:
I've battled trying to narrow this down for a couple of days.
I have a lines style file that contains:
highway=* & maxspeed=40mph {set mcssl=40} highway=primary & mcssl=40 [0x04 resolution 19] highway=* & mcssl=40 [0x04 resolution 22]
I'm then running a stripped down (in JSOM) set of OSM data against this. The data file contains two roads. The first road is the original, whilst the second is a copy (in JOSM) with a name added (and dragged a bit so it is visible). Both have primary=highway and maxspeed=40mph. To me it seems that as both ways have the same maxspeed and highway attributes they should both become visible at the same resolution (ie. 19). However, they don't. The one without the name becomes visible at 3mi (which I guess is 19), whilst the one with the name becomes visible at 0.5mi (which I guess is 22).
It seems therefore that having a name key (or a given value for that key) affects the style file somehow.
I've tried to look at the code but have no idea where to start (as my Java knowledge is virtually zero and I don't know how data moves through the mkgmap).
Files are attached. Mkgmap version: 1180 (although I've tried a few other recent version other the past few days). mapsource: 6.13.7
Any ideas?
------------------------------------------------------------------------
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Felix Hartmann wrote:
Mapsource only uses even resolution. Only gps uses uneven. So as you did not set 20, that might be the reason to go straight up to 22. Try with even resolution only.
I've changed the second line to highway=primary & mcssl=40 [0x04 resolution 20] but it doesn't resolve the problem. I still get two idential roads (except that one has a "name" key) showing at different resolutions. Even if "resolution 19" isn't acceptable to mapsource shouldn't that affect both roads?

On 09/09/09 11:27, MarkS wrote:
Felix Hartmann wrote:
Mapsource only uses even resolution. Only gps uses uneven. So as you did not set 20, that might be the reason to go straight up to 22. Try with even resolution only.
I've changed the second line to
highway=primary& mcssl=40 [0x04 resolution 20]
but it doesn't resolve the problem. I still get two idential roads
The problem is definitely in the generated img and not how mapsource displays it. I would expect that both roads would be at resolution 22 which is probably not what you wanted but that is due to the usual issue of the action rules being run in an indeterminate order. If you need to work around the problem while I look at it try this: (highway=* | highway=primary) & maxspeed=40mph {set mcssl=40} ..Steve

Steve Ratcliffe wrote:
On 09/09/09 11:27, MarkS wrote:
The problem is definitely in the generated img and not how mapsource displays it. I would expect that both roads would be at resolution 22 which is probably not what you wanted but that is due to the usual issue of the action rules being run in an indeterminate order.
If you need to work around the problem while I look at it try this:
(highway=* | highway=primary) & maxspeed=40mph {set mcssl=40}
..Steve
Both appear at the same resolution is wanted. What I was trying to achive was roads in different colours according to speed limit. However, I wanted more important roads to show at lower resolutions so you could zoom in and out easily and have a workable map. The problem lines were part of a much longer style file. Originally the file followed your work around, but this creates long style files because speed limits are defined in one of 5 ways on OSM data. The newer style file comes up with a consistent speed limit defintion first (mcssl) and then later on uses mcssl and highway type - at this point resolution for all primary highways should be 20, trunks 18, motorways 16 and other roads 22. This gives a much short style file. However, in testing I came across this curious bug that the highway key is lost for some roads if a name key exists. I can work around to get what I want but I guess at some point we need to find out why these particular combinations gets odd results.

Hi
The problem lines were part of a much longer style file. Originally the file followed your work around, but this creates long style files because speed limits are defined in one of 5 ways on OSM data.
I appreciate that you cut down the file to make a good example and that for the whole thing it may not be as easy.
I can work around to get what I want but I guess at some point we need to find out why these particular combinations gets odd results.
At first I thought there was something different going on, but it turns out that it is just the usual problem that the actions rules are not run in a well defined order. As such it will be fixed when the changes to guarantee the ordering are done, which should be fairly soon. ..Steve
participants (3)
-
Felix Hartmann
-
MarkS
-
Steve Ratcliffe