Level number too large

Hi All, since something is wrong with downloads on mkgmap site, I have compiled version 4419. I guess this is the latest official release. Now with some old maps I get a new error: Error in style: Error: Level number too large, max=0 I guess this is a conflict between arguments: levels=0:24 and style with declarations like: .... [... level 3] In my opinion, this should be no error, as it wasn't in older versions of mkgmap. It is harmless and quite useful, that style defines higher levels then a particular map compiled with the style. I have attached a patch, but I'm not sure what I'm really changing. Please look at it. -- Best regards, Andrzej

Hi Andrzej, I am a bit confused. If I got that right the check was introduced together with the levels option with r692 in the year 2008 and seems unchanged since then. http://www.mkgmap.org.uk/websvn/diff.php?repname=mkgmap&path=%2Fbranches%2Fs... On the other hand I see no problem with your patch, though I would use slightly different code, see my version. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Mittwoch, 15. Januar 2020 21:41 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Level number too large Hi All, since something is wrong with downloads on mkgmap site, I have compiled version 4419. I guess this is the latest official release. Now with some old maps I get a new error: Error in style: Error: Level number too large, max=0 I guess this is a conflict between arguments: levels=0:24 and style with declarations like: .... [... level 3] In my opinion, this should be no error, as it wasn't in older versions of mkgmap. It is harmless and quite useful, that style defines higher levels then a particular map compiled with the style. I have attached a patch, but I'm not sure what I'm really changing. Please look at it. -- Best regards, Andrzej

Hi Gerd, probably some other changes made this error to appear. I have checked that v4323 compiles my map, while v4386 reports error. I'm not sure about the purpose of the patched function, but I'm afraid there could be problems with following example: options: levels=0:24,1:22 style: .... [... level 2-3] I don't know which part of code would be responsible for discarding an object with levels higher than maximum. If this is due to patched function, then maybe better would be something like: if (level > max) return levels[0].getBits() -1; -- Best regards, Andrzej

Hi Andrzej, please double check. I get the same error when I use r4323 (as expected): D:\mkgmap-4323>java -jar dist\mkgmap.jar --style-file=c:\mystyles\level f:\osm\dummy.osm Time started: Thu Jan 16 16:11:26 CET 2020 Error in style: Error: Level number too large, max=0 Maybe you get a different error message? The only change in TypeReader since 4223 was here: http://www.mkgmap.org.uk/websvn/listing.php?repname=mkgmap&path=%2Fbranches%... Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Donnerstag, 16. Januar 2020 16:01 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Level number too large Hi Gerd, probably some other changes made this error to appear. I have checked that v4323 compiles my map, while v4386 reports error. I'm not sure about the purpose of the patched function, but I'm afraid there could be problems with following example: options: levels=0:24,1:22 style: .... [... level 2-3] I don't know which part of code would be responsible for discarding an object with levels higher than maximum. If this is due to patched function, then maybe better would be something like: if (level > max) return levels[0].getBits() -1; -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, tested again, the error really appeared somewhere after v4323. And I'm compiling the same map since 2014, this is the modification date on my scrips and style. See for example this changelog: http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=4345 Looks like changes include reading of levels from options - file StyleImpl. -- Best regards, Andrzej

Hi Andrzej, yes, I posted a link to the same change. I tested this: 1) create copy of default style (r4323) 2) comment line overview-levels = 4:17, 5:16, 6:15, 7:14, 8:12 3) change line levels to levels = 0:24 4) add rule to polygons landuse=land[0x02 level 3] So, I assume you have a different way to set the levels option and that is causing the problem... Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Donnerstag, 16. Januar 2020 17:00 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Level number too large Hi Gerd, tested again, the error really appeared somewhere after v4323. And I'm compiling the same map since 2014, this is the modification date on my scrips and style. See for example this changelog: http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=4345 Looks like changes include reading of levels from options - file StyleImpl. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, maybe the problem depends not only on levels. I have uploaded simplified version of a set for creating my map. You can examine, what is going on. http://files.mkgmap.org.uk/detail/460 -- Best regards, Andrzej

Hi Andrzej, yes, the important change was in StyleImpl.java With your options the old version read the style using the hard coded default levels "0:24, 1:22, 2:20, 3:18, 4:16" With the new version the levels from the command line option is used instead. It seems I did not expect that the options file in the style doesn't set levels. I'll try to find out if I can implement the wanted check in another way. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Donnerstag, 16. Januar 2020 19:56 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Level number too large Hi Gerd, maybe the problem depends not only on levels. I have uploaded simplified version of a set for creating my map. You can examine, what is going on. http://files.mkgmap.org.uk/detail/460 -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, thanks! I never cared about levels in style, I have always used options. My guess is, that levels doesn't need much control, only there should be foolproof conversion from levels to resolution. I expect, that objects defined with resolution are processed correctly. -- Best regards, Andrzej

Hi Gerd, just after expressing hope for good work of resolution, I got following error in r4420: Error in style: Error: Cannot use type [0x2f17 resolution 24] with level 0 at resolution 23 in style file points, line 270 It is again something, that I have used for a long time. My understanding is that object defined with "resolution 24" simply won't appear on level with resolution 23, regardless if it is level 0 or 1. Maybe you could change this error into a warning? -- Best regards, Andrzej
participants (2)
-
Andrzej Popowski
-
Gerd Petermann