levels in style aren't processed correctly

Hi, I have defined a rule in style like this: highway=path [0x16 road_class=0 road_speed=0 level 0] When I compile map with "--levels=0:24", then I get paths correctly. When I use option "--levels=0:23", then paths are missing. I would expect paths on level 0 regardless of resolution. -- Best regards, Andrzej

They are processed correctly - but there is no support for level 0 being different to 24 yet (at least if you want to have things like autorouting or address search). On 18 May 2015 at 13:58, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi,
I have defined a rule in style like this: highway=path [0x16 road_class=0 road_speed=0 level 0]
When I compile map with "--levels=0:24", then I get paths correctly. When I use option "--levels=0:23", then paths are missing.
I would expect paths on level 0 regardless of resolution.
-- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Felix Hartman - Openmtbmap.org & VeloMap.org Floragasse 9/11 1040 Wien Austria - Österreich

On 18/05/15 12:58, Andrzej Popowski wrote:
Hi,
I have defined a rule in style like this: highway=path [0x16 road_class=0 road_speed=0 level 0]
When I compile map with "--levels=0:24", then I get paths correctly. When I use option "--levels=0:23", then paths are missing.
I would expect paths on level 0 regardless of resolution.
Yes, that appears to be a bug. Although it goes back a long way if so. As a workaround, you can add the levels option to the 'options' file in the style. As regards Felix's comment, even if the lack of routing and index is still true (but I thought that Gerd had fixed that?), the line should still be present but it isn't. Also removing the road_speed/class parameters doesn't affect the outcome. ..Steve

Hi all,
As regards Felix's comment, even if the lack of routing and index is still true (but I thought that Gerd had fixed that?), the line should still be present but it isn't. Also removing the road_speed/class parameters doesn't affect the outcome.
I once thought that I fixed it, but it turned out that some routines still don't work when level 0 is not resolution 24. In trunk we also still have the problem that you have to use --route when you want a correct NET file. Gerd

Hi, I think problem is with initial conversion levels -> resolution. I thought, that levels in style are depreciated, but Steve's suggestion works, I get correct results when using proper levels inside "options" file. If I delete levels form style, then command line values still aren't used. Are they any default values in code? -- Best regards, Andrzej

Hi I've only taken a quick look so far, but it seems that the command line option is applied too late and the built in default is used initially to convert the level to resolution. So level 0 is converted to resolution 24 and this is then (correctly) omitted from a resolution 23 level. I did wonder why this has never been noticed before and I think this is probably because the default style uses resolution rather than level in the type definitions. It is probably only the conversion of level when reading the style that is affected and if this is the case then the fix may be relatively easy. I will look at it some more later. ..Steve On 18 May 2015 16:45:31 BST, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi,
I think problem is with initial conversion levels -> resolution.
I thought, that levels in style are depreciated, but Steve's suggestion
works, I get correct results when using proper levels inside "options" file.
If I delete levels form style, then command line values still aren't used. Are they any default values in code?

Hi
initially to convert the level to resolution. So level 0 is converted to resolution 24 and this is then (correctly) omitted from a resolution 23 level.
Here is a patch to have the --levels option work in this case. A ready built jar file is here: http://files.mkgmap.org.uk/download/267/mkgmap.jar ..Steve

... and here is the patch

Hi Steve, I have tested your precompiled jar, levels seems to work correctly. If I put no "level=" or no "overview-level=" in command line option nor in style I get following error: Error in style: Error: Level number too large, max=1 Could not open style Number of ExitExceptions: 1 I think exception is OK, except message text is unclear. I get error for "overview-level" even when creating no overview img, probably it could be suppressed in this case. -- Best regards, Andrzej

Hi Andrzej
If I put no "level=" or no "overview-level=" in command line option nor in style I get following error:
Error in style: Error: Level number too large, max=1 Could not open style Number of ExitExceptions: 1
I don't understand this. If you have no --levels option then the default should be used, which has a maximum of 4.
I think exception is OK, except message text is unclear.
What do you think that the message text should be?
I get error for "overview-level" even when creating no overview img, probably it could be suppressed in this case.
What are the conditions to cause this error? ..Steve

Hi Steve,
I don't understand this. If you have no --levels option then the default should be used, which has a maximum of 4.
Looks like there is no defaults now, or maybe only level 0 gets a default resolution.
What do you think that the message text should be?
Maybe something like "'level 1' is used in style while its resolution is not defined in option 'levels=' nor "overview-levels=".
What are the conditions to cause this error?
My previous analysis was wrong. This is what I'm doing: - I have modified default style changing some "resolution xx" to "level 0", "level 1" or "level 2". - I have commented "levels=" and "overview-levels=" in "options" file. Now I run compilation with following command line options: 1) --levels=0:22,1:21,2:20 --gmapsupp --no-tdbfile 2) --levels=0:22,1:21 --gmapsupp --no-tdbfile 3) --levels=0:22,1:21 --overview-levels=4:16 --gmapsupp --no-tdbfile Compilation 1) goes correctly. Compilation 2) ends with an error. Compilation 3) creates a map. Map for case 2) consist of only layer 0 and 1, so all references to "level 2" in style could be ignored. I would expect successful compilation at case 2). Next observation is that case 3) shouldn't be different from case 2), there is no definition for "level 2" either. -- Best regards, Andrzej

Hi Andrzej
I don't understand this. If you have no --levels option then the default should be used, which has a maximum of 4.
Looks like there is no defaults now, or maybe only level 0 gets a default resolution.
There is a default for levels: DEFAULT_LEVELS = "0:24, 1:22, 2:20, 3:18, 4:16" There is not a default for overview-levels, although an overview level is constructed based on the highest level in 'levels'.
What do you think that the message text should be?
Maybe something like "'level 1' is used in style while its resolution is not defined in option 'levels=' nor "overview-levels=".
OK.
What are the conditions to cause this error?
My previous analysis was wrong. This is what I'm doing: - I have modified default style changing some "resolution xx" to "level 0", "level 1" or "level 2". - I have commented "levels=" and "overview-levels=" in "options" file.
Now I run compilation with following command line options: 1) --levels=0:22,1:21,2:20 --gmapsupp --no-tdbfile 2) --levels=0:22,1:21 --gmapsupp --no-tdbfile 3) --levels=0:22,1:21 --overview-levels=4:16 --gmapsupp --no-tdbfile
Compilation 1) goes correctly. Compilation 2) ends with an error. Compilation 3) creates a map.
Oh I see now. In case 2 the highest level is 1, whereas in 3) the max level is 2, since the normal and overview levels are combined. I can change this so that a level 2 would translate to the resolution of the level less than or equal to it. ..Steve
participants (4)
-
Andrzej Popowski
-
Felix Hartmann
-
Gerd Petermann
-
Steve Ratcliffe