{"id":716,"date":"2010-03-03T13:15:18","date_gmt":"2010-03-03T11:15:18","guid":{"rendered":"https:\/\/openmtbmap.org\/?page_id=716"},"modified":"2023-06-30T08:03:36","modified_gmt":"2023-06-30T06:03:36","slug":"render-maps-mkgmap","status":"publish","type":"page","link":"https:\/\/openmtbmap.org\/it\/about-2\/archive\/render-maps-mkgmap\/","title":{"rendered":"Disegnare le proprie Mappe con mkgmap"},"content":{"rendered":"<p><\/p>\n<p>&nbsp;<\/p>\n<p>Questa pagina esiste solo in inglese, perch\u00e8 \u00e8 impossibile riuscirci se non si conosce l'Inglese visto che tutta la documentazione disponibile \u00e8 in inglese.<\/p>\n<div>\n<h3>Prerequisites:<\/h3>\n<p>a) Install Java JRE 1.6 or later.<\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #808080;\">If you have problems doing so, there is a good wiki page here:\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/wiki.openstreetmap.org\/wiki\/Java_Runtime_Environment\" href=\"https:\/\/wiki.openstreetmap.org\/wiki\/Java_Runtime_Environment\">http:\/\/wiki.openstreetmap.org\/wiki\/Java_Runtime_Environment<\/a><\/span><\/p>\n<p>b) Download mkgmap latest:\u00a0mkgmap_latest.zip<\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #808080;\">You can read up on mkgmap on the mkgmap wiki page:\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/wiki.openstreetmap.org\/wiki\/Mkgmap\" href=\"https:\/\/wiki.openstreetmap.org\/wiki\/Mkgmap\">http:\/\/wiki.openstreetmap.org\/wiki\/Mkgmap<\/a><\/span><\/p>\n<p style=\"margin-left: 80px;\"><span style=\"color: #808080;\">The mkgmap Mailing List is subsicrable here:\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/www.mkgmap.org.uk\/mailman\/listinfo\/mkgmap-dev\" href=\"https:\/\/www.mkgmap.org.uk\/mailman\/listinfo\/mkgmap-dev\">http:\/\/www.mkgmap.org.uk\/mailman\/listinfo\/mkgmap-dev<\/a><\/span><\/p>\n<p style=\"margin-left: 80px;\"><span style=\"color: #808080;\">Or here as a forum\/archive:\u00a0http:\/\/n2.nabble.com\/Mkgmap-Development-f4411397.html<\/span><\/p>\n<p style=\"margin-left: 80px;\"><span style=\"color: #808080;\">Note I'm using a patched mkgmap version, if you want to profit from the patches that have some enhancements, especially for biking, then you can find the patches I'm using inside the SVN. I'm not going to explain how to use the patches, please google if you don't know how to apply a SVN patch.<\/span><\/p>\n<p>c) Get mkgmap Splitter from here:\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/www.mkgmap.org.uk\/splitter\/\" href=\"https:\/\/www.mkgmap.org.uk\/download\/splitter.html\">http:\/\/www.mkgmap.org.uk\/splitter\/<\/a><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #808080;\">the helpfile for the splitter on the wiki is not up to date (\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/www.mkgmap.org.uk\/page\/tile-splitter\" href=\"https:\/\/www.mkgmap.org.uk\/doc\/splitter.html\">http:\/\/www.mkgmap.org.uk\/page\/tile-splitter<\/a>\u00a0), if you want more info on the splitter, run<\/span><\/p>\n<pre><span style=\"color: #808080;\">java -jar splitter.jar --version<\/span><\/pre>\n<p>d) Get the OSM map data you want to compile<\/p>\n<p style=\"margin-left: 40px;\">I recommend download osm extracts from Geofabrik:\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/download.geofabrik.de\/osm\/europe\/\" href=\"http:\/\/download.geofabrik.de\/\">http:\/\/download.geofabrik.de\/osm\/europe\/<\/a><\/p>\n<p>e) Get the OpenMTBMap.org Stylefile:<\/p>\n<p style=\"margin-left: 40px;\">Please note, I do not offer the style-file anymore. This has several reasons: a) I nearly offer worldwide coverage on maps. b) During the last two years, I got only twice a proposal for change. c) Quite a few people\/companies copied stuff from the style-file, without proper attribution.<\/p>\n<p>f) Put mkgmap.jar,\u00a0 splitter.jar and the maps (country.osm.bz2 - don't unextract them) to c:\\garmin\\mkgmap\\ - the OpenMTBMap.org style has to be extracted and the files placed into c:\\garmin\\mkgmap\\openmtbmap_style\\. If you change the folder you simply have to change the commands bellow to fit.<\/p>\n<h3>\u00a0<\/h3>\n<h3>Splitting the Map:<\/h3>\n<p>First \"split\" the maps. This step is needed in order to create the tiles that mkgmap.jar will later compile. Only for very small countries with few OSM data you can avoid this step:<\/p>\n<p>In your console (cmd.exe for Windows) go to the directiory where you put the \"prerequisites (on windows you enter i.e.\u00a0\u00a0<em>cd c:\/garmin\/mkgmap\/\u00a0<\/em>)<\/p>\n<pre> java -Xmx4000m -ea -jar splitter.jar --max-nodes=600000 --overlap=4000 --max-areas=255 --cache=\"cache\" --description=\"germany\" --mapid=\"12340000\" --max-nodes=\"600000\" --no-trim --overlap=\"4000\" --status-freq=\"600\" germany.osm.bz2<\/pre>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">Xmx4000m gives 4000 MB of RAM to Java. Adjust it to the maximum of RAM you can attribute without your PC starting to swap heavily (e.g. if you have 6GB of RAM set this to 4000M; if you use 2000M and split europe, you will have to decrease --max-areas). This is a java option.<\/span><\/p>\n<h4 style=\"margin-left: 40px;\"><span style=\"color: #696969;\">Here is a quick overview about frequently usedswitches, put them behind splitter.jar on the command:<\/span><\/h4>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>overlap=4000<\/var>\u00a0- In order for mkgmap to stitch the tiles together there needs to be an overlap. 1000 is default, with 4000 one can avoid some errors.<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>no-trim<\/var>\u00a0- You can use this in order to have the map looking nicer in Mapsource, on the other hand if you combine several mapsets on your GPS and are in a border region then an empty map may overlap another map with information so it has disadvantages too.<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>description=germany<\/var>\u00a0- Put a description here, best use the name of the country\/region of the map you're splitting<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>mapid=12340000<\/var>\u00a0This will determine the file name the splitter uses. I usually set it to the \"FID\" that I give the maps later and add \"0000\"<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">last the map input file. splitter.jar will accept bz2 zipped files, or unzipped .osm<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>cache=folder<\/var>\u00a0(you have to create this subfolder in mkgmap directory) is given to speed up splitting if splitter.jar has to do several passes (e.g. splitting europe).<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>max-nodes=600000<\/var>\u00a0specify the tile size. if 600000 should be a save value for any European country. If you dare to compile the whole world, you might even resort to 400000<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\"><var>max-areas=255<\/var>\u00a0decrease it if you run out of memory on splitting. Mkgmap will then make more passes. In this case you should set -cache=cache which will create a folder \/cache where splitter caches data.<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">You can read up on the commands by running: java -jar splitter.jar --version<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Compiling the Map:<\/h3>\n<p>Now that we have splitted the maps, we can compile them with mkgmap:<\/p>\n<pre>java -ea -Xmx4000M -jar mkgmap.jar --style-file=c:\\garmin\\mkgmap\\openmtbmap_style --max-jobs --generate-sea=polygons,extend-sea-sectors,close-gaps=6000 --reduce-point-density=5.4 --x-reduce-point-density-polygon=5.4 --index --transparent --adjust-turn-headings --ignore-maxspeeds --ignore-turn-restrictions --remove-short-arcs=4 --description=openmtbmap_de --location-autofill=1 --route --country-abbr=de --country-name=germany --mapname=12340000 --family-id=1234 --product-id=1 --series-name=\"openmtbmap_de_%date%\" --family-name=\"mtbmap_de_%date%\" --x-tdbfile --overview-mapname=mapset --area-name=\"Germany_%date%_openmtbmap.org\" -c template.args<\/pre>\n<h4 style=\"margin-left: 40px;\"><span style=\"color: #696969;\">Switches that you might need to adjust:<\/span><\/h4>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">style-file=folder adjust it to tell mkgmap where the OpenMTBMap style-file is to be found.<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">max-jobs if you run out of memory on compiling, you can use --max-jobs=2 to only have 2 processor cores compiling.<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">index if you set this than an address index is generated (which is needed to search for addresses). Note this address index cannot be included to gmapsupp directly by mkgmap, but has to be exported with Mapsource.<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">transparent - I set the map transparent an afterwards run\u00a0<em>gmt.exe -w -n *.img<\/em>\u00a0to set the map opaque again. This increases the performance of the map on old GPS as no 0x4b background polygon is set. If you omit running gmt.exe then the maps will show above all other maps when activated on GPS (only valid for streets and POI, polygons are not shown above other maps).<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">mapname=12340000 Sets the name of the maps output (similar to --mapid for splitter.jar)<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">family-id=1234 Set the FID for the mapset. Use one that is not used yet (you can check what FIDs are already used by installed maps with Mapset Toolkit)<\/span><\/p>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">-c template.args This file was created by the splitter and tells mkgmap how to compile the maps. Alternatively you can exchange this by\u00a0<em>*.osm.gz<\/em><\/span><\/p>\n<h4 style=\"margin-left: 40px;\"><span style=\"color: #696969;\">Some other useful switches for mkgmap<\/span><\/h4>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">--gmapsupp - Write a gmapsupp.img file that can be uploaded to a Garmin or\u00a0 placed in \"\/Garmin\" in a (micro)SD card (such as by mounting the device in USB mass storage mode or putting the memory card into a card reader).<\/span><\/p>\n<h4 style=\"margin-left: 40px;\"><span style=\"color: #696969;\">Read up on the Switches:<\/span><\/h4>\n<p style=\"margin-left: 40px;\"><span style=\"color: #696969;\">The most up to date switches can be found by running: java -jar mkgmap.jar<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Installing the Map:<\/h3>\n<p>Easiest is to copy the whole output (*.img *.tdb *.mdx ) into a new folder, and then use Mapsettoolkit (version 1.75 beta or newer) to register it in Mapsource. You will also need to use a typfile. You can open the .prj files to compile .TYP-files with maptk. Read\u00a0<a class=\"linkification-ext\" title=\"Linkification: https:\/\/openmtbmap.org\/tutorials\/install\/installation-with-mapsettoolkit\/\" href=\"https:\/\/openmtbmap.org\/about-2\/archive\/installation-with-mapsettoolkit\/\">https:\/\/openmtbmap.org\/tutorials\/install\/installation-with-mapsettoolkit\/<\/a>\u00a0to see the details on how to do it. If you create a map of Europe or another large map, the index might be broken and prevent mapsource from starting up if registered. If so trash *.mdr.img and *.mdx and reinstall the map. Alternatively you could install nsis, and use nsis to create an installer.<br \/>\n\u00a0<\/p>\n<h3>Additional Resources:<\/h3>\n<p>Openstreetmap Mailinglist archives:\u00a0http:\/\/n2.nabble.com\/OpenStreetMap-f660402.html<\/p>\n<p>Openstreetmap Forum:\u00a0<a class=\"linkification-ext\" title=\"Linkification: http:\/\/forum.openstreetmap.org\/index.php\" href=\"https:\/\/community.openstreetmap.org\/\">http:\/\/forum.openstreetmap.org\/index.php<\/a><\/p>\n<\/div>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<\/p>\n<p>&nbsp;<\/p>\n<p>Questa pagina esiste solo in inglese, perch\u00e8 \u00e8 impossibile riuscirci se non si conosce l&#8217;Inglese visto che tutta la documentazione disponibile \u00e8 in inglese.<\/p>\n<p> Prerequisites: <\/p>\n<p>a) Install Java JRE 1.6 or later.<\/p>\n<p style=\"margin-left: 40px;\">If you have problems doing so, there is a good wiki page here: http:\/\/wiki.openstreetmap.org\/wiki\/Java_Runtime_Environment<\/p>\n<p>b) Download mkgmap latest: mkgmap_latest.zip<\/p>\n<p style=\"margin-left: 40px;\">You can read up on mkgmap on the mkgmap wiki page: http:\/\/wiki.openstreetmap.org\/wiki\/Mkgmap<\/p>\n<p style=\"margin-left: 80px;\">The mkgmap Mailing List is subsicrable here: http:\/\/www.mkgmap.org.uk\/mailman\/listinfo\/mkgmap-dev<\/p>\n<p style=\"margin-left: 80px;\">Or here as a forum\/archive: http:\/\/n2.nabble.com\/Mkgmap-Development-f4411397.html<\/p>\n<p style=\"margin-left: 80px;\">Note I&#8217;m using a patched mkgmap version, if you want to profit from the patches that have some enhancements, especially for biking, then you can find the patches I&#8217;m using inside the SVN. I&#8217;m not going to explain how to use the patches, please google if you don&#8217;t know how to apply a SVN patch.<\/p>\n<p>c) Get mkgmap Splitter from here: http:\/\/www.mkgmap.org.uk\/splitter\/<\/p>\n<p style=\"margin-left: 40px;\">the helpfile for the splitter on the wiki is not up to date ( http:\/\/www.mkgmap.org.uk\/page\/tile-splitter ), if you want more info on the splitter, run<\/p>\n<p> java -jar splitter.jar &#8211;version <\/p>\n<p>d) Get the OSM map data you want to compile<\/p>\n<p style=\"margin-left: 40px;\">I recommend download osm extracts from [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1354,"menu_order":9,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-716","page","type-page","status-publish","hentry","odd"],"_links":{"self":[{"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/pages\/716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/comments?post=716"}],"version-history":[{"count":0,"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/pages\/716\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/pages\/1354"}],"wp:attachment":[{"href":"https:\/\/openmtbmap.org\/it\/wp-json\/wp\/v2\/media?parent=716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}