
Hi all, I'm faced with this error : java -jar ../../../bin/mkgmap-r3057/mkgmap.jar --style-file=src/ --style=style-FR --check-styles Time started: Wed Feb 26 23:20:35 CET 2014 checking style: style-FR Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at uk.me.parabola.mkgmap.general.LevelInfo.createFromString(LevelInfo.java:74) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:275) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:160) at uk.me.parabola.mkgmap.main.Main.readOneStyle(Main.java:382) at uk.me.parabola.mkgmap.main.Main.checkStyles(Main.java:362) at uk.me.parabola.mkgmap.main.Main.processOption(Main.java:264) at uk.me.parabola.mkgmap.CommandArgsReader$CommandOption.processArg(CommandArgsReader.java:303) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:125) at uk.me.parabola.mkgmap.main.Main.main(Main.java:117) When I invoke mkgmap as usual to compile a map, it fails after outputting this exact same exception trace 8 times. No map produced. I've narrowed the issue to the "options" file, pasted here : # # 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:24,1:23,2:22,3:20,4:18 overview-levels=5:17,6:15,7:14 If I comment out the 2 lines, then mkgmap runs fine (style checking and map compiling). This file was OK before I migrated from OS X Snow Leopard to Mavericks. Before : OS X 10.6.8, java6, mkgmap r2685. Now OS X 10.9.2, java7, mkgmap 3057 (same exception with r2960)

Hi Paco, this seems to be a problem with java7. The program crashes while complaining about the last part of this line :"Levels specification not all numbers " overview-levels=5:17,6:15,7:14 I assume that you have a special character following the 7:14 pair, maybe uncommon line ending 0x0d ? I'll try to find a correction for the crash. Gerd
Date: Wed, 26 Feb 2014 23:40:15 +0100 From: paco.tyson@free.fr To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] Mkgmap exception while reading "options" file
Hi all,
I'm faced with this error :
java -jar ../../../bin/mkgmap-r3057/mkgmap.jar --style-file=src/ --style=style-FR --check-styles Time started: Wed Feb 26 23:20:35 CET 2014 checking style: style-FR Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at uk.me.parabola.mkgmap.general.LevelInfo.createFromString(LevelInfo.java:74) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:275) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:160) at uk.me.parabola.mkgmap.main.Main.readOneStyle(Main.java:382) at uk.me.parabola.mkgmap.main.Main.checkStyles(Main.java:362) at uk.me.parabola.mkgmap.main.Main.processOption(Main.java:264) at uk.me.parabola.mkgmap.CommandArgsReader$CommandOption.processArg(CommandArgsReader.java:303) at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:125) at uk.me.parabola.mkgmap.main.Main.main(Main.java:117)
When I invoke mkgmap as usual to compile a map, it fails after outputting this exact same exception trace 8 times. No map produced.
I've narrowed the issue to the "options" file, pasted here : # # 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:24,1:23,2:22,3:20,4:18 overview-levels=5:17,6:15,7:14
If I comment out the 2 lines, then mkgmap runs fine (style checking and map compiling). This file was OK before I migrated from OS X Snow Leopard to Mavericks. Before : OS X 10.6.8, java6, mkgmap r2685. Now OS X 10.9.2, java7, mkgmap 3057 (same exception with r2960) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, Selon Gerd Petermann <gpetermann_muenchen@hotmail.com>:
Hi Paco,
this seems to be a problem with java7.
I'm not in front of my computer but I remember that I downloaded the java7 jdk from oracle's website. It's the latest version, 64bit.
The program crashes while complaining about the last part of this line :"Levels specification not all numbers " overview-levels=5:17,6:15,7:14
I assume that you have a special character following the 7:14 pair, maybe uncommon line ending 0x0d ?
Maybe, I checked the documentation for a requirement on the encoding and line ending of the style files but found nothing. So I assumed that wasn't an issue. Which line ending should I use ? By the way, what encoding should I use ?
I'll try to find a correction for the crash.
Thanks, right now this bug is a showstopper, I can't compile any map.
Gerd
Date: Wed, 26 Feb 2014 23:40:15 +0100 From: paco.tyson@free.fr To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] Mkgmap exception while reading "options" file
Hi all,
I'm faced with this error :
java -jar ../../../bin/mkgmap-r3057/mkgmap.jar --style-file=src/ --style=style-FR --check-styles Time started: Wed Feb 26 23:20:35 CET 2014 checking style: style-FR Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at uk.me.parabola.mkgmap.general.LevelInfo.createFromString(LevelInfo.java:74) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:275) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:160) at uk.me.parabola.mkgmap.main.Main.readOneStyle(Main.java:382) at uk.me.parabola.mkgmap.main.Main.checkStyles(Main.java:362) at uk.me.parabola.mkgmap.main.Main.processOption(Main.java:264) at
uk.me.parabola.mkgmap.CommandArgsReader$CommandOption.processArg(CommandArgsReader.java:303)
at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:125) at uk.me.parabola.mkgmap.main.Main.main(Main.java:117)
When I invoke mkgmap as usual to compile a map, it fails after outputting this exact same exception trace 8 times. No map produced.
I've narrowed the issue to the "options" file, pasted here : # # 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:24,1:23,2:22,3:20,4:18 overview-levels=5:17,6:15,7:14
If I comment out the 2 lines, then mkgmap runs fine (style checking and map compiling). This file was OK before I migrated from OS X Snow Leopard to Mavericks. Before : OS X 10.6.8, java6, mkgmap r2685. Now OS X 10.9.2, java7, mkgmap 3057 (same exception with r2960) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Paco, -- View this message in context: http://gis.19327.n5.nabble.com/Mkgmap-exception-while-reading-options-file-t... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hi Paco, I hope r3069 helps you to find out where the problem is. Gerd
Date: Thu, 27 Feb 2014 11:51:21 +0100 From: paco.tyson@free.fr To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Mkgmap exception while reading "options" file
Hi Gerd,
Selon Gerd Petermann <gpetermann_muenchen@hotmail.com>:
Hi Paco,
this seems to be a problem with java7.
I'm not in front of my computer but I remember that I downloaded the java7 jdk from oracle's website. It's the latest version, 64bit.
The program crashes while complaining about the last part of this line :"Levels specification not all numbers " overview-levels=5:17,6:15,7:14
I assume that you have a special character following the 7:14 pair, maybe uncommon line ending 0x0d ?
Maybe, I checked the documentation for a requirement on the encoding and line ending of the style files but found nothing. So I assumed that wasn't an issue. Which line ending should I use ? By the way, what encoding should I use ?
I'll try to find a correction for the crash.
Thanks, right now this bug is a showstopper, I can't compile any map.
Gerd
Date: Wed, 26 Feb 2014 23:40:15 +0100 From: paco.tyson@free.fr To: mkgmap-dev@lists.mkgmap.org.uk Subject: [mkgmap-dev] Mkgmap exception while reading "options" file
Hi all,
I'm faced with this error :
java -jar ../../../bin/mkgmap-r3057/mkgmap.jar --style-file=src/ --style=style-FR --check-styles Time started: Wed Feb 26 23:20:35 CET 2014 checking style: style-FR Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 at uk.me.parabola.mkgmap.general.LevelInfo.createFromString(LevelInfo.java:74) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readRules(StyleImpl.java:275) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:160) at uk.me.parabola.mkgmap.main.Main.readOneStyle(Main.java:382) at uk.me.parabola.mkgmap.main.Main.checkStyles(Main.java:362) at uk.me.parabola.mkgmap.main.Main.processOption(Main.java:264) at
uk.me.parabola.mkgmap.CommandArgsReader$CommandOption.processArg(CommandArgsReader.java:303)
at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:125) at uk.me.parabola.mkgmap.main.Main.main(Main.java:117)
When I invoke mkgmap as usual to compile a map, it fails after outputting this exact same exception trace 8 times. No map produced.
I've narrowed the issue to the "options" file, pasted here : # # 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:24,1:23,2:22,3:20,4:18 overview-levels=5:17,6:15,7:14
If I comment out the 2 lines, then mkgmap runs fine (style checking and map compiling). This file was OK before I migrated from OS X Snow Leopard to Mavericks. Before : OS X 10.6.8, java6, mkgmap r2685. Now OS X 10.9.2, java7, mkgmap 3057 (same exception with r2960) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Selon Gerd Petermann <gpetermann_muenchen@hotmail.com>:
Hi Paco,
I hope r3069 helps you to find out where the problem is.
Gerd
Using r3069, when checking the style, I get : "Error: Levels specification not all numbers: 5:17,6:15,7:14null check 7:14null" I found out with an hex editor that : - line endings are LF - encoding doesn't matter : latin1 or utf-8 output the same result However the file was missing a LF at the end of the last line. Simply adding a blank line at the end of the file solved the issue. Out of curiosity, I tried removing the last LF character in the lines file but it doesn't trigger the issue. Thanks Gerd and Steve for the help. :)

Hi Paco, ah,yes, missing line feeds at the end of the file are causing trouble in many programs. Sometimes such a last line is completely ignored. I can reproduce the problem on Windows, so I wonder if the migration to Mavericks really changed your file ? It's a good idea to add an empty line to the end of all style files. @Steve : Attached is a patch that solves this issue, but I think the real problem is that isEOF is not set to true at the right place in TokenScanner. Can you have a look at it? Gerd
Date: Thu, 27 Feb 2014 22:45:05 +0100 From: paco.tyson@free.fr To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Mkgmap exception while reading "options" file
Selon Gerd Petermann <gpetermann_muenchen@hotmail.com>:
Hi Paco,
I hope r3069 helps you to find out where the problem is.
Gerd
Using r3069, when checking the style, I get :
"Error: Levels specification not all numbers: 5:17,6:15,7:14null check 7:14null"
I found out with an hex editor that : - line endings are LF - encoding doesn't matter : latin1 or utf-8 output the same result
However the file was missing a LF at the end of the last line. Simply adding a blank line at the end of the file solved the issue.
Out of curiosity, I tried removing the last LF character in the lines file but it doesn't trigger the issue.
Thanks Gerd and Steve for the help. :) _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 28/02/14 06:19, Gerd Petermann wrote:
@Steve : Attached is a patch that solves this issue, but I think the real problem is that isEOF is not set to true at the right place in TokenScanner. Can you have a look at it?
OK. I did try without a final line ending and it didn't give me an error, so I didn't suggest it. Now however I am getting an error. I also get an error when I use mac line endings (CR only). Although modern macs with OS X use unix style line endings it is plausible that the previous version he was using had some kind of comparability for old style line endings which was not present after the upgrade. Anyway I will look into it. Thanks Steve

Hi Steve, Gerd, Selon Steve Ratcliffe <steve@parabola.me.uk>:
On 28/02/14 06:19, Gerd Petermann wrote:
@Steve : Attached is a patch that solves this issue, but I think the real problem is that isEOF is not set to true at the right place in TokenScanner. Can you have a look at it?
OK. I did try without a final line ending and it didn't give me an error, so I didn't suggest it. Now however I am getting an error.
I also get an error when I use mac line endings (CR only). Although modern macs with OS X use unix style line endings it is plausible that the previous version he was using had some kind of comparability for old style line endings which was not present after the upgrade.
The OS migration hasn't modified the file, I checked with a backup. The LF (none of the files has CR line endings) was already missing. As I also had to specify the right encoding in my Ant build script, I guess java7 is the cause for this changed behaviour. Anyway, thanks guys for your help.
Anyway I will look into it.
Thanks Steve _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi
Maybe, I checked the documentation for a requirement on the encoding and line ending of the style files but found nothing. So I assumed that wasn't an issue. Which line ending should I use ? By the way, what encoding should I use ?
Its just a plain text file and the line endings don't matter. Or they shouldn't and I couldn't get it to go wrong by adding others. I would re create the file from scratch, without using cut and paste and see what happens. If that doesn't work could zip up the whole style and send me it. Best wishes ..Steve
participants (4)
-
Gerd Petermann
-
GerdP
-
paco.tyson@free.fr
-
Steve Ratcliffe