[OSM-dev] Stack Overflow in mkgmap

Karl Newman siliconfiend at gmail.com
Wed Mar 26 15:57:21 GMT 2008

On Wed, Mar 26, 2008 at 10:23 AM, Rainer Rothkegel <
rainer.rothkegel at googlemail.com> wrote:

> I get a StackOverflow Exception when trying to create a Garmin map for
> India.
> I downloaded the India map data via
> wget
> http://www.informationfreeway.org/api/0.5/*[bbox=67.28027,5.35352,89.07715,33.39476]<http://www.informationfreeway.org/api/0.5/*%5Bbbox=67.28027,5.35352,89.07715,33.39476%5D>
> -O india-osmxapi.osm
> This resulted in a 130M osm file.
> Then I tried to convert it to a Garmin map file via
> java -Xmx512M -jar /home/rainer/gps/osm/mkgmap/dist/mkgmap.jar
> --gmapsupp --description="OSM India Map $(date)" india-osmxapi.osm
> After a few minutes of processing, I got the following stack trace:
> Exception in thread "main" java.lang.StackOverflowError
>        at java.util.ArrayList.toArray(ArrayList.java:306)
>        at java.util.logging.Logger.getHandlers(Logger.java:1214)
>        at
> java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:995)
>        at java.util.logging.Logger.log(Logger.java:468)
>        at java.util.logging.Logger.doLog(Logger.java:494)
>        at java.util.logging.Logger.log(Logger.java:517)
>        at uk.me.parabola.log.Logger.arrayFormat(Logger.java:213)
>        at uk.me.parabola.log.Logger.warn(Logger.java:183)
>        at uk.me.parabola.mkgmap.build.MapArea.pickArea(MapArea.java:503)
>        at uk.me.parabola.mkgmap.build.MapArea.split(MapArea.java:218)
>        at
> uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.java
> :111)
>        at
> uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.java
> :112)
>        at
> uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.java
> :112)
> [last line repeated for zillions of times]
> I checked out the source code and found that line 112 of
> MapSplitter.java is the following recursion:
> addAreasToList(sublist, alist);
> I am currently running the mkgmap in debug mode using the default
> logging properties (java
> -Dlog.config=mkgmap/dist/resources/logging.properties ...) but
> (probably  due to the high volume of data being logged) the application
> has run for more than 1 hour without terminating yet.
> My question: Is this likely a data problem or a problem with mkgmap?
> (Btw. creating a Garmin map file works fine if I process only the data
> for south India.)
> Thanks in advance,
> Rainer

You'll probably have to manually split the file and then run mkgmap on the
separate sections. Each section needs to have a unique map id (use the
--mapname=XXXXXXXX command-line argument). But maybe you don't have to do
this yourself. According to the README:
Processing more than one file at a time

It is usual to split Garmin maps up into smaller tiles.  This is because
older GPS units (before large SD cards were cheap) had a limited amount of
for maps, and secondly because there are limits within the map format

Anyway, then you can use something like sendmap (www.cGPSMapper.com) to
recombine the resulting img files and download it to your GPS. Or try the
gmaptool that Ludwig just mentioned.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20080326/dc627a53/attachment.html>

More information about the dev mailing list