Presently, I am trying to make my windows script to generate garmin maps more flexible. Here is the script, that stops with an error at the very end:
set drive=%cd:~0,3%
set tilesdir=%drive%map\OSM_Tiles
set centraleuropepath=%drive%map\Centraleurope.osm
set templateargspath=%tilesdir%\template.args
set mkgmapoutputdir=%drive%map\Output
set osmosispath=%drive%map\Osmosis-0.39
set splitterpath=%drive%map\Splitter-r171
set mkgmappath=%drive%map\mkgmap-r1908
cd %drive%map
wget http://download.geofabrik.de/osm/europe.osm.bz2
7za e -y europe.osm.bz2
java -Xmx1600m -cp "%osmosispath%\lib\default\plexus-classworlds-2.2.2.jar" -Dapp.home="%osmosispath%" -Dclassworlds.conf="%osmosispath%\config\plexus.conf" org.codehaus.classworlds.Launcher --read-xml file="europe.osm" --bounding-box idTrackerType=BitSet top=60 left=4 bottom=47 right=16 --write-xml file=%centraleuropepath%
cd %splitterpath%
java -Xmx1600m -jar splitter.jar --cache=.\temp --max-areas=70 --max-nodes=1000000 --output-dir=%tilesdir% %Centraleuropepath%
cd %mkgmappath%
java -Xmx1600m -jar mkgmap.jar --output-dir=%mkgmapoutputdir% --max-jobs --index --reduce-point-density=10 --description=OSM_DE --country-name=centraleurope --country-abbr=EU --name-tag-list="name:de,name,int_name" --style-file=%drive%map\My_Style_13\ --generate-sea=multipolygon --family-id=1331 --product-id=1 --series-name=OSM_Germany --family-name=OSM_Germany --area-name=Germany --overview-mapname=OSM_Centraleurope --net --gmapsupp --tdbfile --route --add-pois-to-areas --road-name-pois=0x640a --draw-priority=25 --latin1 --make-opposite-cycleways --remove-short-arcs -c %templateargspath% %drive%map\My_13.typ
pause
The script stops at the end of the mkgmap-task (after all files were generated) with an error:
Exception in thread “main” java.lang.IllegalArgumentException
at java.nio.ByteBuffer.allocate(Unknown Source)
at uk.me.parabola.imgfmt.sys.Directory.sync(Directory.java:176)
at uk.me.parabola.imgfmt.sys.ImgFS.sync(ImgFS.java:230)
at uk.me.parabola.imgfmt.sys.ImgFS.close(ImgFS.java:240)
at uk.me.parabola.mkgmap.combiners.GmapsuppBuilder.onFinish(GmapsuppBuilder.java:124)
at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:419)
at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.java:126)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:129)
I have tested an older version of mkgmap, but it also leads to a (different) error here. If the result is installed in MapSource by MapSetToolkit, there is a tile in the baltic sea showing no water and a tile in south sweden showing only water with towns in it.
Any ideas, what went wrong here?