
Hi Mike This is an area of code I've changed and it should be able to cope with many items at the same location without recursing. Do you have some sample data? what are the items (point/line/shape extended?) Ticker On Tue, 2017-02-14 at 17:40 +0000, Mike Baggaley wrote:
Hi Gerd, since this change I am getting a java.lang.StackOverflowError crash caused by the code recursively attempting to split something which is unsplittable (assuming the split is based on location), as I have a large number of points at exactly the same location (from external data I add to the OSM data).
The offending line is at uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.ja va:187) . It is failing on my system with a depth of 2342. I suggest there needs to be a maximum depth after which it should give up trying to split.
} else if (mustSplit) { // can't reduce size, so force more subdivisions log.debug("splitting area by contents", area); MapArea[] sublist = area.split(1, 1, bounds, true); addAreasToList(sublist, alist, depth + 1); continue; }
I am unsure whether you would want a fixed depth limit, would want it to be set by parameter, would prefer to catch the error or think it would be possible to see whether the proposed area split has made any improvement, and give up if it hasn't.
Regards, Mike
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev