@echo off setlocal cls set reg=%1 set withdl=%2 set withext=%3 set mymkgmap="C:\garmin\mkgmap\dist\mkgmap.jar" set mysplitter="C:\garmin\splitter\dist\splitter.jar" set groundtruth="C:\Garmin\GroundTruth-1.8.740.17\GroundTruth.exe" set osmosis=call C:\Garmin\osmosis\package\bin\osmosis.bat set styles=..\..\..\aio\aiostyles if "%reg%"=="" set reg=sh if "%withdl%"=="" set withdl=1 if "%withext%"=="" set withext=pbf if "%withext%"=="1" set withext=bz2 if "%withext%"=="2" set withext=pbf rem n�tige Tools: rem div. unix-tools for windows (sed, wget, grep, find, bunzip2, ...) rem NSIS-Installer: http://nsis.sourceforge.net rem GMapTool http://www.anpo.republika.pl/download.html, daraus gmt.exe rem gpsbabel http://www.gpsbabel.org rem git http://git-scm.com rem ant und subversion-client rem jdk (javac, java) rem osmosis --read-xml enableDateParsing=no file=europe.osm.bz2 --bounding-box left=5.8 right=15.1 bottom=47.2 top=55.2 completeWays=no --write-xml file=germany.osm rem GroundTruth.sh contours -o myfile.ibf --bounds="47,15,48,16" --int 10 --gridlat=1 --gridlon=1 rem GroundTruth.sh ibf2osm -i myfile.ibf --tagce --cat="100,20" rem zus�tzliche Gebiete k�nnen/m�ssen weiter unten eingepflegt werden set find="c:\Program Files (x86)\wbin\find.exe" set nsis="C:\Program Files (x86)\NSIS\makensis.exe" /V1 set gmt=".\gmt.exe" set gpsbabel="c:\Program Files (x86)\GPSBabel\gpsbabel" set edit="C:\Program Files (x86)\Notepad++\notepad++.exe" call :initdir goto :doit rem ####################################################### :setRegion rem ####################################################### set bbox= if /I "%reg%"=="sh" ( call :getData germany/schleswig-holstein.osm schleswig-holstein.osm set iso=DE set country=germany set mapgrp=6324 set bounds=53,8,55,11 ) if /I "%reg%"=="de" ( call :getData germany.osm germany.osm set iso=DE set country=germany set mapgrp=6424 set bounds=47,6,55,15 ) if /I "%reg%"=="dk" ( call :getData denmark.osm denmark.osm set iso=DK set country=denmark set mapgrp=6524 set addrtiles=addrtiles set bounds=54.5,8,58,13 ) if /I "%reg%"=="hh" ( call :getData germany/hamburg.osm hamburg.osm set iso=DE set country=germany set mapgrp=6624 set bounds=53.3,9.7,53.7,10.4 ) if /I "%reg%"=="nord" ( call :getEurope ../europe.osm europe.osm set iso=DE set country=germany set mapgrp=6724 set bounds=51.89,6.83,57.87,15.27 set bbox=top=57.87 left=6.83 bottom=51.89 right=15.27 rem set bounds=53.0,9.0,54.0,11.0 rem set bbox=top=54.0 left=9.0 bottom=53.0 right=11.0 ) if "%mapgrp%"=="0" goto :error unbekannte Region goto :eof rem ####################################################### :initdir if not exist tiles.%reg% md tiles.%reg% cd tiles.%reg% for %%d in (gbasemap gaddr gfixme gboundary gosb gmaxspeed tmp) do ( if not exist %%d md %%d ) cd .. goto :eof :mk_mkgmap setlocal cd c:\Garmin\mkgmap call svn update call ant dist endlocal goto :eof :mk_splitter setlocal cd c:\Garmin\splitter call svn update call ant dist endlocal goto :eof :mk_osmosis setlocal if exist c:\Garmin\osmosis ( cd c:\Garmin\osmosis call svn update ) else ( cd c:\Garmin svn checkout http://svn.openstreetmap.org/applications/utils/osmosis/trunk osmosis cd osmosis ) call ant publish endlocal goto :eof rem ####################################################### :updateprgs rem Zuerst mal die AIO-Stylefile holen if exist aiostyles ( cd aiostyles call git fetch -v cd .. ) else call git clone git://github.com/aiomaster/aiostyles.git call :mk_mkgmap call :mk_splitter if "%withdl%"=="2" call :mk_osmosis goto :eof rem ####################################################### :getOSB wget -m -nH -ndd http://www.gary68.de/osm/qa/gpx/allbugs.gpx if not exist allbugs.wrk copy allbugs.gpx allbugs.wrk %find% . -maxdepth 1 -name allbugs.wrk -newer allbugs.gpx -exec echo "OK allbugs.wrk newer" ; | grep OK if ERRORLEVEL 1 goto :doEditWork goto :doOSBsed :doEditWork xcopy /dy allbugs.gpx allbugs.wrk grep "" allbugs.wrk | wc -l | grep 1 if not ERRORLEVEL 1 goto :doOSBsed echo mehr als ein "" in allbugs.wrk, bitte bearbeiten! %edit% allbugs.wrk :doOSBsed sed "s/closed>/name>/g;s///g;s/<\/extensions>//g" allbugs.wrk > allbugs.tmp %gpsbabel% -i gpx -o osm -f allbugs.tmp -F allbugs.osm del allbugs.tmp goto :eof rem ####################################################### :getData set url=%1 set osm=%2 set workfile=%osm%.%withext% if "%withdl%"=="" goto :eof if "%withdl%"=="0" goto :eof wget -m -nH -ndd http://download.geofabrik.de/osm/europe/%url%.%withext% goto :eof :getEurope set url=%1 set osm=%2 set workfile=%osm%.%withext% if "%withdl%"=="" goto :eof if "%withdl%"=="0" goto :eof ftp -s:..\ftp.dat -A ftp5.gwdg.de goto :eof rem ####################################################### :splitIt setlocal if not exist %2 md %2 pushd %2 if not exist tmp md tmp set p= if not exist %workfile% set p=..\ if not exist *.gz goto :split1 %find% . -maxdepth 1 -name %mapgrp%0345.osm.gz -newer %p%%workfile% -exec echo "OK, split %p%%workfile% already done" ; | grep OK if ERRORLEVEL 1 del *.gz if exist *.gz goto :split2 :split1 echo %TIME% splitting java -Xmx4000M -jar "%mysplitter%" --cache=tmp --mapid=%mapgrp%0345 --max-nodes=%1 %p%%workfile% :split2 popd endlocal goto :eof rem ####################################################### :cutOSMOSIS %osmosis% --rb ..\%osm%.%withext% --bb clipIncompleteEntities=true %bbox% --wb %reg%.osm.pbf omitmetadata=true set workfile=%reg%.osm.pbf goto :eof rem ####################################################### rem ####################################################### :doit if not "%withdl%"=="" call :updateprgs if not "%withdl%"=="" call :getOSB title %reg% cd tiles.%reg% set addrtiles=.. set mapgrp=0 set maxnodes=1000000 call :setRegion if not "%bbox%"=="" call :cutOSMOSIS rem Die Kartendaten splitten rem Ben�tigt wird die Sun Java JRE6 call :splitIt %maxnodes% . if "%addrtiles%"==".." goto :noaddrsplit call :splitIt 100000 %addrtiles% set addrtiles=..\%addrtiles% :noaddrsplit del /q "%USERPROFILE%\APPDATA\roaming\garmin\MAPsource\tilecache\*.*" set OPTIONS= --max-jobs --country-name=%country% --country-abbr=%iso% --area-name="%iso%_%DATE%" --latin1 --code-page=1252 --gmapsupp --nsis --keep-going --transparent --name-tag-list='name:de,name,name:latin,name:en' set GBASEMAPOPTIONS= %OPTIONS% --tdbfile --add-pois-to-areas --make-all-cycleways --link-pois-to-ways --remove-short-arcs --net --route --index --location-autofill=1 --generate-sea=multipolygon,extend-sea-sectors,close-gaps=1000,floodblocker --adjust-turn-headings --reduce-point-density=4 --reduce-point-density-polygon=8 --merge-lines rem --generate-sea=extend-sea-sectors set NOBASEMAPOPTIONS= %OPTIONS% --tdbfile --no-poi-address --no-sorted-roads --ignore-turn-restrictions --ignore-osm-bounds if not exist gcontour md gcontour cd gcontour echo %TIME% "Contour" if not exist contours10.ibf %groundtruth% contours -o contours10.ibf --bounds="%bounds%" --int 10 --gridlat=1 --gridlon=1 if not exist output %groundtruth% ibf2osm -i contours10.ibf --tagce --cat="100,20" --outputfileformat=contours{0}.osm.gz if not exist gmapsupp.img ( copy /y %styles%\contour.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\contour_style\ --description=contour_Layer %NOBASEMAPOPTIONS% --ignore-maxspeeds --family-id=45 --product-id=25 --series-name=OSM-AllInOne-%reg%-contour --family-name=aio-%reg%-contour --mapname=%mapgrp%8625 --draw-priority=100 output\*.osm.gz contour.TYP %nsis% osmmap.nsi ) cd .. cd gbasemap echo %TIME% "Basemap" copy /y %styles%\basemap.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\basemap_style\ --description=Openstreetmap %GBASEMAPOPTIONS% --family-id=4 --product-id=45 --series-name=OSM-AllInOne-%reg%-bmap --family-name=aio-%reg%-OSM --mapname=%mapgrp%0345 --draw-priority=10 ..\*.osm.gz basemap.TYP %nsis% osmmap.nsi start "aio-%reg%-OSM" aio-%reg%-OSM /S cd ..\gaddr echo %TIME% "Adressen" copy /y %styles%\addr.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\addr_style\ --description=Adressen %NOBASEMAPOPTIONS% --family-id=5 --location-autofill=1 --ignore-maxspeeds --product-id=40 --series-name=OSM-AllInOne-%reg%-Addr --family-name=aio-%reg%-ADRESSEN --mapname=%mapgrp%1345 --draw-priority=20 --no-poi-address --no-sorted-roads --add-pois-to-areas --transparent --gmapsupp %addrtiles%\*.osm.gz addr.TYP %nsis% osmmap.nsi cd ..\gfixme echo %TIME% "Fixme" copy /y %styles%\fixme.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\fixme_style\ --description=Fixme_Layer %NOBASEMAPOPTIONS% --ignore-maxspeeds --family-id=3 --product-id=33 --series-name=OSM-AllInOne-%reg%-Fixme --family-name=aio-%reg%-FIXME --mapname=%mapgrp%2345 --draw-priority=22 ..\*.osm.gz fixme.TYP %nsis% osmmap.nsi cd ..\gboundary echo %TIME% "Boundary" copy /y %styles%\boundary.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\boundary_style\ --description=Boundary_Layer %NOBASEMAPOPTIONS% --ignore-maxspeeds --family-id=6 --product-id=30 --series-name=OSM-AllInOne-%reg%-boundary --family-name=aio-%reg%-boundary --mapname=%mapgrp%0625 --draw-priority=21 ..\*.osm.gz boundary.TYP %nsis% osmmap.nsi cd ..\gmaxspeed echo %TIME% "Maxspeed" copy /y %styles%\maxspeed.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\maxspeed_style\ --description=Maxspeed %NOBASEMAPOPTIONS% --family-id=84 --product-id=15 --series-name=OSM-AllInOne-%reg%-Maxspeed --family-name=aio-%reg%-MAXSPEED --mapname=%mapgrp%6345 --draw-priority=19 ..\*.osm.gz maxspeed.TYP %nsis% osmmap.nsi cd ..\gosb echo %TIME% "OSM-Bugs" copy /y %styles%\osb.TYP java -Xmx4000M -jar %mymkgmap% --max-jobs --style-file=%styles%\osb_style\ --description=Openstreetbugs %NOBASEMAPOPTIONS% --family-id=3 --product-id=7 --series-name=OSM-AllInOne-%reg%-OSB --family-name=aio-%reg%-OSB --mapname=%mapgrp%3345 --draw-priority=23 ..\..\allbugs.osm osb.TYP %nsis% osmmap.nsi rem Jetzt alles zu einem gmapsupp.img cd ..\.. %gmt% -jo tiles.%reg%\gmapsupp.img tiles.%reg%\gbasemap\gmapsupp.img tiles.%reg%\gaddr\gmapsupp.img tiles.%reg%\gfixme\gmapsupp.img tiles.%reg%\gosb\gmapsupp.img tiles.%reg%\gmaxspeed\gmapsupp.img tiles.%reg%\gboundary\gmapsupp.img tiles.%reg%\gcontour\gmapsupp.img title %reg% fertig endlocal echo %TIME% goto :eof :error echo Fehler: %1 %2 %3 %4 %5 %6 %7 %8 %9 %0 goto :eof