OpenStreetMap User's Diaries
Update on using mkgmap for Garmin maps of Central Asia
It seems mkgmap was updated and no longer uses sea-latest.zip or bounds-latest.zip. I had to tweak the splitter and mkgmap scripts to deal with that, and decided to create a separate script for each country in Central Asia. I am still puzzling over how to make the Caspian Sea render properly without using those zip files.
The style sheets for Central Asian countries can be found on Githu
It seems mkgmap was updated and no longer uses sea-latest.zip or bounds-latest.zip. I had to tweak the splitter and mkgmap scripts to deal with that, and decided to create a separate script for each country in Central Asia. I am still puzzling over how to make the Caspian Sea render properly without using those zip files.
The style sheets for Central Asian countries can be found on Github at https://github.com/allanmustard/mkgmap, file tstan.zip.
Here is what I have now for splitter and mkgmap scripts:
***> In the splitter script, change the file name ending in .pbf to the file name you draw data from.
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Kazakhstan –overlap=4000 –keep-complete=true –mapid=12340001 Kazakhstan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Kazakhstan” –family-id=1234 –family-name=Kazakhstan –series-name=Central_Asia –area-name=Kazakhstan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Kyrgyzstan –overlap=4000 –keep-complete=true –mapid=12350001 Kyrgyzstan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Kyrgyzstan” –family-id=1235 –family-name=Kyrgyzstan –series-name=Central_Asia –area-name=Kyrgyzstan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Tajikistan –overlap=4000 –keep-complete=true –mapid=12360001 Tajikistan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Tajikistan” –family-id=1236 –family-name=Tajikistan –series-name=Central_Asia –area-name=Tajikistan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Turkmenistan –overlap=4000 –keep-complete=true –mapid=12370001 Turkmenistan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Turkmenistan” –family-id=1237 –family-name=Turkmenistan –series-name=Central_Asia –area-name=Turkmenistan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Uzbekistan –overlap=4000 –keep-complete=true –mapid=12380001 Uzbekistan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Uzbekistan” –family-id=1238 –family-name=Uzbekistan –series-name=Central_Asia –area-name=Uzbekistan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
N.B. The -Xmx parameter sets the maximum amount of memory the routine may use. The higher this number, the faster the program runs, but the number may not exceed available RAM on the computer. For example, if your computer has 32Gb of RAM, setting -Xmx16384m (about half of total RAM) is appropriate. If your computer has only 16Gb of RAM, use a smaller number, perhaps Xmx8192m.
I also learned the hard way mkgmap .img files will not work in Garmin Drive GPS units. The Garmin Drive GPS navigators require the NTU (new technology unicode) format and refuse to read mkgmap-generated .img files, which seem to be only in the original NT format. It was good news for my daughter, however, who gratefully accepted the Garmin Drive GPS I had bought before discovering it doesn’t like .img files produced by mkgmap.
It seems mkgmap was updated and no longer uses sea-latest.zip or bounds-latest.zip. I had to tweak the splitter and mkgmap scripts to deal with that, and decided to create a separate script for each country in Central Asia. I am still puzzling over how to make the Caspian Sea render properly without using those zip files.
The style sheets for Central Asian countries can be found on Githu
It seems mkgmap was updated and no longer uses sea-latest.zip or bounds-latest.zip. I had to tweak the splitter and mkgmap scripts to deal with that, and decided to create a separate script for each country in Central Asia. I am still puzzling over how to make the Caspian Sea render properly without using those zip files.
The style sheets for Central Asian countries can be found on Github at https://github.com/allanmustard/mkgmap, file tstan.zip.
Here is what I have now for splitter and mkgmap scripts:
***> In the splitter script, change the file name ending in .pbf to the file name you draw data from.
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Kazakhstan –overlap=4000 –keep-complete=true –mapid=12340001 Kazakhstan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Kazakhstan” –family-id=1234 –family-name=Kazakhstan –series-name=Central_Asia –area-name=Kazakhstan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Kyrgyzstan –overlap=4000 –keep-complete=true –mapid=12350001 Kyrgyzstan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Kyrgyzstan” –family-id=1235 –family-name=Kyrgyzstan –series-name=Central_Asia –area-name=Kyrgyzstan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Tajikistan –overlap=4000 –keep-complete=true –mapid=12360001 Tajikistan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Tajikistan” –family-id=1236 –family-name=Tajikistan –series-name=Central_Asia –area-name=Tajikistan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Turkmenistan –overlap=4000 –keep-complete=true –mapid=12370001 Turkmenistan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Turkmenistan” –family-id=1237 –family-name=Turkmenistan –series-name=Central_Asia –area-name=Turkmenistan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
java.exe -Xmx4000m -jar splitter\splitter.jar –output-dir=split –description=Uzbekistan –overlap=4000 –keep-complete=true –mapid=12380001 Uzbekistan.pbf
java.exe -Xmx16384m -jar mkgmap\mkgmap.jar –copyright-message=”Copyright OpenStreetMap and contributors” –output-dir=map –route –index –split-name-index –location-autofill=is_in,nearest –preserve-element-order –style-file=.\tstan –add-pois-to-areas –link-pois-to-ways –nearby-poi-rules-config=.\tstan\duppoi –unicode –housenumbers –road-name-pois –process-exits –process-destination –split-name-index –add-boundary-nodes-at-admin-boundaries=2 –housenumbers –poi-address –generate-sea=multipolygon –country-name=”Uzbekistan” –family-id=1238 –family-name=Uzbekistan –series-name=Central_Asia –area-name=Uzbekistan –gmapi –gmapsupp -c split\template.args split*.osm.pbf
N.B. The -Xmx parameter sets the maximum amount of memory the routine may use. The higher this number, the faster the program runs, but the number may not exceed available RAM on the computer. For example, if your computer has 32Gb of RAM, setting -Xmx16384m (about half of total RAM) is appropriate. If your computer has only 16Gb of RAM, use a smaller number, perhaps Xmx8192m.
I also learned the hard way mkgmap .img files will not work in Garmin Drive GPS units. The Garmin Drive GPS navigators require the NTU (new technology unicode) format and refuse to read mkgmap-generated .img files, which seem to be only in the original NT format. It was good news for my daughter, however, who gratefully accepted the Garmin Drive GPS I had bought before discovering it doesn’t like .img files produced by mkgmap.
OpenStreetMap Blogs




