
I receive an error when running the current splitter version: Exception in thread "worker-6" java.lang.StringIndexOutOfBoundsException: String index out of range: -3 at java.lang.String.getChars(String.java:860) at uk.me.parabola.splitter.OSMXMLWriter.writeString(OSMXMLWriter.java:199) at uk.me.parabola.splitter.OSMXMLWriter.write(OSMXMLWriter.java:96) at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.processElement(SplitP rocessor.java:407) at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.run(SplitProcessor.ja va:442) at java.lang.Thread.run(Thread.java:679) What does this mean?

Hi, probably an error in splitter. It seems to be caused by a long string in the data. Can you tell me how to reproduce it? Gerd RheinSkipper wrote
I receive an error when running the current splitter version:
Exception in thread "worker-6" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
at java.lang.String.getChars(String.java:860)
at uk.me.parabola.splitter.OSMXMLWriter.writeString(OSMXMLWriter.java:199)
at uk.me.parabola.splitter.OSMXMLWriter.write(OSMXMLWriter.java:96)
at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.processElement(SplitP rocessor.java:407)
at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.run(SplitProcessor.ja va:442)
at java.lang.Thread.run(Thread.java:679)
What does this mean?
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error-tp5752745p5752748.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

First I extract my bbox from the planet: read="planet/planet-latest.osm.pbf" write="planet/bbox.osm.pbf omitmetadata=true" zipname=osm_europe_central bbox="left=-8 right=25 bottom=38 top=61" JAVACMD_OPTIONS="-Djava.io.tmpdir=$HOME/tmp -Xmx6G" osmosis/bin/osmosis --read-pbf $read --tee 1 outPipe.0=a --bounding-box inPipe.0=a completeWays=yes $bbox --write-pbf $write Then I run the splitter: java -XX:+UseCompressedOops -Xmx6500M -jar splitter/splitter.jar --max-nodes=1500000 --mixed=yes --no-trim --keep-complete --precomp-sea=sea --overlap=0 --resolution=16 --geonames-file=cities15000.zip --description=INT-Offshore --output=xml --output-dir=tiles planet/bbox.osm.pbf 2>err1.txt
-----Ursprüngliche Nachricht----- Von: mkgmap-dev-bounces@lists.mkgmap.org.uk [mailto:mkgmap-dev- bounces@lists.mkgmap.org.uk] Im Auftrag von GerdP Gesendet: Montag, 11. März 2013 14:47 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Splitter Error
Hi,
probably an error in splitter. It seems to be caused by a long string in the data. Can you tell me how to reproduce it?
Gerd
RheinSkipper wrote
I receive an error when running the current splitter version:
Exception in thread "worker-6" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
at java.lang.String.getChars(String.java:860)
at
uk.me.parabola.splitter.OSMXMLWriter.writeString(OSMXMLWriter.java:199
)
at uk.me.parabola.splitter.OSMXMLWriter.write(OSMXMLWriter.java:96)
at
uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.processElement(
SplitP rocessor.java:407)
at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.run(SplitProces sor.ja va:442)
at java.lang.Thread.run(Thread.java:679)
What does this mean?
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error- tp5752745p5752748.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Okay, I'll try to reproduce that. Would it be a problem to use o5m or pbf for output? Gerd RheinSkipper wrote
First I extract my bbox from the planet:
read="planet/planet-latest.osm.pbf" write="planet/bbox.osm.pbf omitmetadata=true" zipname=osm_europe_central bbox="left=-8 right=25 bottom=38 top=61" JAVACMD_OPTIONS="-Djava.io.tmpdir=$HOME/tmp -Xmx6G" osmosis/bin/osmosis --read-pbf $read --tee 1 outPipe.0=a --bounding-box inPipe.0=a completeWays=yes $bbox --write-pbf $write
Then I run the splitter:
java -XX:+UseCompressedOops -Xmx6500M -jar splitter/splitter.jar --max-nodes=1500000 --mixed=yes --no-trim --keep-complete --precomp-sea=sea --overlap=0 --resolution=16 --geonames-file=cities15000.zip --description=INT-Offshore --output=xml --output-dir=tiles planet/bbox.osm.pbf 2>err1.txt
-----Ursprüngliche Nachricht----- Von:
mkgmap-dev-bounces@.org
[mailto:mkgmap-dev-
bounces@.org
] Im Auftrag von GerdP
Gesendet: Montag, 11. März 2013 14:47 An:
mkgmap-dev@.org
Betreff: Re: [mkgmap-dev] Splitter Error
Hi,
probably an error in splitter. It seems to be caused by a long string in the data. Can you tell me how to reproduce it?
Gerd
RheinSkipper wrote
I receive an error when running the current splitter version:
Exception in thread "worker-6" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
at java.lang.String.getChars(String.java:860)
at
uk.me.parabola.splitter.OSMXMLWriter.writeString(OSMXMLWriter.java:199
)
at uk.me.parabola.splitter.OSMXMLWriter.write(OSMXMLWriter.java:96)
at
uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.processElement(
SplitP rocessor.java:407)
at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.run(SplitProces sor.ja va:442)
at java.lang.Thread.run(Thread.java:679)
What does this mean?
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error- tp5752745p5752748.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error-tp5752745p5752762.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Well, I used xml output just for some experiments. I tried to sort the output to control the draw priority of polygons. According to http://www.cferrero.net/maps/mkgmap_tiddlywiki.html#--preserve-element-order this should work, but it didn’t. So I can switch back to pbf again for now. Not being able to control what is drawn on top of what is still my biggest problem in generating marine maps. Nautical chartplotters do not support TYP files, so controlling draw-priority via TYP is not an option for the Garmin marine lineup.
Okay, I'll try to reproduce that. Would it be a problem to use o5m or pbf for output?

RheinSkipper wrote
Well, I used xml output just for some experiments. I tried to sort the output to control the draw priority of polygons. According to http://www.cferrero.net/maps/mkgmap_tiddlywiki.html#--preserve-element-order this should work, but it didn’t. So I can switch back to pbf again for now.
Not being able to control what is drawn on top of what is still my biggest problem in generating marine maps. Nautical chartplotters do not support TYP files, so controlling draw-priority via TYP is not an option for the Garmin marine lineup.
Hmm, --preserve-element-order only makes sure that (most of) the data is always processed in the same order. I doubt that you can really influnce the order of data in the img file. The algorithm that is used to distribute data into the sub regions is likely to randomize the result for each small change in the style or osm data. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error-tp5752745p5752814.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

Do you see a chance to implement an option to control the order of data in the img file? In our experiments tweaking the order of data in the osm file did have an influence on draw order. But as you described the influence was more or less random. For rendering shaded depth areas in a sea map it is absolutely necessary to make sure that the depth area polygons are drawn on top of sea or riverbank polygons and not below them. As another approach to this problem I was thinking about leaving away the sea polygons at all (so they do not cover my depth shading) and creating Bluechart type maps instead of topo maps. As far as I understand, the difference between Bluechart and topo is that blank unmapped areas are rendered as water on a Bluechart but rendered as land on a topo map. So we need sea and riverbank polygons on topos but on a Bluechart we need land polygons. Unfortunately as mkgmap can only generate sea polygons and no land polygons, this approach is out of reach at the moment.
Hmm, --preserve-element-order only makes sure that (most of) the data is always processed in the same order. I doubt that you can really influnce the order of data in the img file. The algorithm that is used to distribute data into the sub regions is likely to randomize the result for each small change in the style or osm data.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error- tp5752745p5752814.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

No! Garmin´s marine chartplotters (like GPSMap 526 or 720) do not evaluate any typ files at all. Garmin says that marine devices do not support user defined types and they do not plan to implement this.
If you use a typ file you can set the draworder of every polygon
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi RheinSkipper, I traced through the code and I fear I am not able to reproduce the problem. Are you able to reproduce it? Maybe also with smaller bboxes? If yes, can you post a link to your input file for splitter? Else we may have to add some debugging code to your splitter version. Gerd RheinSkipper wrote
First I extract my bbox from the planet:
read="planet/planet-latest.osm.pbf" write="planet/bbox.osm.pbf omitmetadata=true" zipname=osm_europe_central bbox="left=-8 right=25 bottom=38 top=61" JAVACMD_OPTIONS="-Djava.io.tmpdir=$HOME/tmp -Xmx6G" osmosis/bin/osmosis --read-pbf $read --tee 1 outPipe.0=a --bounding-box inPipe.0=a completeWays=yes $bbox --write-pbf $write
Then I run the splitter:
java -XX:+UseCompressedOops -Xmx6500M -jar splitter/splitter.jar --max-nodes=1500000 --mixed=yes --no-trim --keep-complete --precomp-sea=sea --overlap=0 --resolution=16 --geonames-file=cities15000.zip --description=INT-Offshore --output=xml --output-dir=tiles planet/bbox.osm.pbf 2>err1.txt
-----Ursprüngliche Nachricht----- Von:
mkgmap-dev-bounces@.org
[mailto:mkgmap-dev-
bounces@.org
] Im Auftrag von GerdP
Gesendet: Montag, 11. März 2013 14:47 An:
mkgmap-dev@.org
Betreff: Re: [mkgmap-dev] Splitter Error
Hi,
probably an error in splitter. It seems to be caused by a long string in the data. Can you tell me how to reproduce it?
Gerd
RheinSkipper wrote
I receive an error when running the current splitter version:
Exception in thread "worker-6" java.lang.StringIndexOutOfBoundsException: String index out of range: -3
at java.lang.String.getChars(String.java:860)
at
uk.me.parabola.splitter.OSMXMLWriter.writeString(OSMXMLWriter.java:199
)
at uk.me.parabola.splitter.OSMXMLWriter.write(OSMXMLWriter.java:96)
at
uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.processElement(
SplitP rocessor.java:407)
at uk.me.parabola.splitter.SplitProcessor$OSMWriterWorker.run(SplitProces sor.ja va:442)
at java.lang.Thread.run(Thread.java:679)
What does this mean?
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error- tp5752745p5752748.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error-tp5752745p5752783.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

I had the problem a couple of times. But when I run splitter again with same input and same script, the problem is sometimes away. I will try to reproduce it with smaller input.
-----Ursprüngliche Nachricht----- Von: mkgmap-dev-bounces@lists.mkgmap.org.uk [mailto:mkgmap-dev- bounces@lists.mkgmap.org.uk] Im Auftrag von GerdP Gesendet: Montag, 11. März 2013 16:37 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Splitter Error
Hi RheinSkipper,
I traced through the code and I fear I am not able to reproduce the problem. Are you able to reproduce it? Maybe also with smaller bboxes? If yes, can you post a link to your input file for splitter? Else we may have to add some debugging code to your splitter version.
Gerd

RheinSkipper wrote
I had the problem a couple of times. But when I run splitter again with same input and same script, the problem is sometimes away. I will try to reproduce it with smaller input.
Good luck! I fear this might be a hardware problem. Or maybe some kind of multitasking problem in the JRE. If you cannot reproduce it for sure it is unlikely that I will be able to do it. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error-tp5752745p5752812.html Sent from the Mkgmap Development mailing list archive at Nabble.com.

I updated JRE from 1.6 to 1.7, updated osmosis to latest version and gave it 16 GB of memory. With a small bbox "left=8 right=9 bottom=49.5 top=50.5" osmosis still produces 6 GB of bbox data. And running splitter on this bbox always results in: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at uk.me.parabola.splitter.DensityMap.addNode(DensityMap.java:132) at uk.me.parabola.splitter.DensityMapCollector.processNode(DensityMapCollector. java:58) at uk.me.parabola.splitter.BinaryMapParser.parseDense(BinaryMapParser.java:113) at crosby.binary.BinaryParser.parse(BinaryParser.java:124) at crosby.binary.BinaryParser.handleBlock(BinaryParser.java:68) at crosby.binary.file.FileBlock.process(FileBlock.java:135) at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:34) at uk.me.parabola.splitter.PrecompSeaReader.processMap(PrecompSeaReader.java:85 ) at uk.me.parabola.splitter.Main.calculateAreas(Main.java:479) at uk.me.parabola.splitter.Main.split(Main.java:205) at uk.me.parabola.splitter.Main.start(Main.java:157) at uk.me.parabola.splitter.Main.main(Main.java:146)
Good luck! I fear this might be a hardware problem. Or maybe some kind of multitasking problem in the JRE. If you cannot reproduce it for sure it is unlikely that I will be able to do it.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error- tp5752745p5752812.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi, if you have no good reason to use resolution=16, remove this parm. That will reduce the required memory in this phase. Gerd RheinSkipper wrote
I updated JRE from 1.6 to 1.7, updated osmosis to latest version and gave it 16 GB of memory.
With a small bbox "left=8 right=9 bottom=49.5 top=50.5" osmosis still produces 6 GB of bbox data.
And running splitter on this bbox always results in:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at uk.me.parabola.splitter.DensityMap.addNode(DensityMap.java:132) at uk.me.parabola.splitter.DensityMapCollector.processNode(DensityMapCollector. java:58) at uk.me.parabola.splitter.BinaryMapParser.parseDense(BinaryMapParser.java:113) at crosby.binary.BinaryParser.parse(BinaryParser.java:124) at crosby.binary.BinaryParser.handleBlock(BinaryParser.java:68) at crosby.binary.file.FileBlock.process(FileBlock.java:135) at crosby.binary.file.BlockInputStream.process(BlockInputStream.java:34) at uk.me.parabola.splitter.PrecompSeaReader.processMap(PrecompSeaReader.java:85 ) at uk.me.parabola.splitter.Main.calculateAreas(Main.java:479) at uk.me.parabola.splitter.Main.split(Main.java:205) at uk.me.parabola.splitter.Main.start(Main.java:157) at uk.me.parabola.splitter.Main.main(Main.java:146)
Good luck! I fear this might be a hardware problem. Or maybe some kind of multitasking problem in the JRE. If you cannot reproduce it for sure it is unlikely that I will be able to do it.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error- tp5752745p5752812.html Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Splitter-Error-tp5752745p5752962.html Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (4)
-
Gerd Petermann
-
GerdP
-
Minko
-
RheinSkipper