On Wed, Mar 26, 2008 at 10:23 AM, Rainer Rothkegel <<a href="mailto:rainer.rothkegel@googlemail.com">rainer.rothkegel@googlemail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I get a StackOverflow Exception when trying to create a Garmin map for<br>
India.<br>
I downloaded the India map data via<br>
wget<br>
<a href="http://www.informationfreeway.org/api/0.5/*%5Bbbox=67.28027,5.35352,89.07715,33.39476%5D" target="_blank">http://www.informationfreeway.org/api/0.5/*[bbox=67.28027,5.35352,89.07715,33.39476]</a><br>
-O india-osmxapi.osm<br>
<br>
This resulted in a 130M osm file.<br>
<br>
Then I tried to convert it to a Garmin map file via<br>
java -Xmx512M -jar /home/rainer/gps/osm/mkgmap/dist/mkgmap.jar<br>
--gmapsupp --description="OSM India Map $(date)" india-osmxapi.osm<br>
<br>
After a few minutes of processing, I got the following stack trace:<br>
<br>
Exception in thread "main" java.lang.StackOverflowError<br>
        at java.util.ArrayList.toArray(ArrayList.java:306)<br>
        at java.util.logging.Logger.getHandlers(Logger.java:1214)<br>
        at<br>
java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:995)<br>
        at java.util.logging.Logger.log(Logger.java:468)<br>
        at java.util.logging.Logger.doLog(Logger.java:494)<br>
        at java.util.logging.Logger.log(Logger.java:517)<br>
        at uk.me.parabola.log.Logger.arrayFormat(Logger.java:213)<br>
        at uk.me.parabola.log.Logger.warn(Logger.java:183)<br>
        at uk.me.parabola.mkgmap.build.MapArea.pickArea(MapArea.java:503)<br>
        at uk.me.parabola.mkgmap.build.MapArea.split(MapArea.java:218)<br>
        at<br>
uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.java:111)<br>
        at<br>
uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.java:112)<br>
        at<br>
uk.me.parabola.mkgmap.build.MapSplitter.addAreasToList(MapSplitter.java:112)<br>
[last line repeated for zillions of times]<br>
<br>
<br>
I checked out the source code and found that line 112 of<br>
MapSplitter.java is the following recursion:<br>
addAreasToList(sublist, alist);<br>
<br>
I am currently running the mkgmap in debug mode using the default<br>
logging properties (java<br>
-Dlog.config=mkgmap/dist/resources/logging.properties ...) but<br>
(probably  due to the high volume of data being logged) the application<br>
has run for more than 1 hour without terminating yet.<br>
<br>
My question: Is this likely a data problem or a problem with mkgmap?<br>
(Btw. creating a Garmin map file works fine if I process only the data<br>
for south India.)<br>
<br>
Thanks in advance,<br>
Rainer<br>
</blockquote></div><br>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:<br>
Processing more than one file at a time<br>---------------------------------------<br><br>It is usual to split Garmin maps up into smaller tiles.  This is because<br>older GPS units (before large SD cards were cheap) had a limited amount of memory<br>
for maps, and secondly because there are limits within the map format<br>itself.<br><br>Anyway, then you can use something like sendmap (<a href="http://www.cGPSMapper.com">www.cGPSMapper.com</a>) to recombine the resulting img files and download it to your GPS. Or try the gmaptool that Ludwig just mentioned.<br>
<br>Karl<br>