[mkgmap-dev] [Patch] Error in BoundaryUtil
From WanMil wmgcnfg at web.de on Sun Mar 11 19:08:54 GMT 2012
i Gerd, can you please explain in short what's the difference between the three formats (my thinking): * Legacy (original - int coords) * Raw (float coords) * Quadtree (admin level areas merged to the quadtree format) loadQuadTree (Quadtree format?) => loadQuadTreeFromStream (Quadtree format?) => readStreamRawFormat (Raw format?) => readArea (Legacy format) At least it is irritating to me if there is a method readStreamRawFormat which reads raw and/or legacy format. I would also propose a change to the header of the new raw and quadtree format. In the legacy format the first String in the file gives the release of mkgmap. You added a "_raw" or "_quadtree" (?) to mark the new formats. This is unclean but required to support the legacy format. But legacy format support can be dropped in the future (I think at least in the end of 2012). So to be open for future other changes it would be good to have a kind of format identification. This could be added after the creation time. Having this format identification future changes to the format could be easily and much cleaner added. WanMil > Hi WanMil, > > hmm, we have two errors here. I can confirm that my patch doesn't solve > all problems, > it just allows again to read the old *.bnd format and the new quadtree > format, but mkgmap > fails to read the intermediate format produced by the preparers 1st pass. > > > Date: Sun, 11 Mar 2012 18:25:21 +0100 > > From: wmgcnfg at web.de > > To: mkgmap-dev at lists.mkgmap.org.uk > > Subject: Re: [mkgmap-dev] [Patch] Error in BoundaryUtil > > > > Hi Gerd, > > > > without your patch preparing boundaries works. > > No, it doesn't. It stops (crashes) without any error message when trying > to read the *.bnd > files produced in the 1st pass. You can verify this by looking at the > header of > the new *.bnd files, they have the suffix _raw, not _quadtree. > > The new patch fixes this, but not the missing error detection. > > I think we need a try/catch block somewhere, either in Preparer or > BoundaryPreparer. > Will you take care of this? > > Gerd > > > > Using your patch I get the following exception. > > > > java.util.concurrent.ExecutionException: > > java.lang.IllegalArgumentException: Ill > > egal Capacity: -572471432 > > at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) > > at java.util.concurrent.FutureTask.get(Unknown Source) > > at > > uk.me.parabola.mkgmap.main.Preparer.runPreparer(Preparer.java:92) > > at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:349) > > at > > uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.ja > > va:126) > > at uk.me.parabola.mkgmap.main.Main.main(Main.java:114) > > Caused by: java.lang.IllegalArgumentException: Illegal Capacity: > -572471432 > > at java.util.ArrayList.<init>(Unknown Source) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.readStreamRawF > > ormat(BoundaryUtil.java:282) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadQuadTreeFr > > omStream(BoundaryUtil.java:459) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadQuadTree(B > > oundaryUtil.java:145) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryUtil.loadQuadTree(B > > oundaryUtil.java:120) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer$QuadTreeWo > > rker.call(BoundaryPreparer.java:236) > > at > > uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreparer$QuadTreeWo > > rker.call(BoundaryPreparer.java:221) > > at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) > > at java.util.concurrent.FutureTask.run(Unknown Source) > > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown > > Source) > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown > > Source) > > at java.lang.Thread.run(Unknown Source) > > > > My mkgmap call is: > > java -jar mkgmap.jar --max-jobs=4 > > --createboundsfile=africa-boundaries.osm.gz --bounds=bounds/africa *.osm > > > > WanMil > > > > > Hi WanMil, > > > > > > sorry, one of my last patches for the performance branch corrupted > > > BoundaryUtil. > > > It was no longer able to read the legacy *.bnd format (also created > in the > > > preparer) :-( > > > > > > Attached is the patch. > > > > > > Gerd > > > > > > http://gis.19327.n5.nabble.com/file/n5554370/BoundaryUtil.java.patch > > > BoundaryUtil.java.patch > > > > > > -- > > > View this message in context: > http://gis.19327.n5.nabble.com/Patch-Error-in-BoundaryUtil-tp5554370p5554370.html > > > Sent from the Mkgmap Development mailing list archive at Nabble.com. > > > _______________________________________________ > > > mkgmap-dev mailing list > > > mkgmap-dev at lists.mkgmap.org.uk > > > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > > > > _______________________________________________ > > mkgmap-dev mailing list > > mkgmap-dev at lists.mkgmap.org.uk > > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > > > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev at lists.mkgmap.org.uk > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
- Previous message: [mkgmap-dev] [Patch] Error in BoundaryUtil
- Next message: [mkgmap-dev] [Patch] Error in BoundaryUtil
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list