How To Create Garmin Topo Maps - Part 9 - Compiling Data
Author: Dan Blomberg | Last updated March 15th, 2016 at 07:35pm
The final part of this lesson is two parts. The first, and required, step is converting the .mp files to Garmin compatible .img files. The second, optional, step is creating a NSIS setup file to allow people to easily install your new map.
Creating .img Files
First make sure you have cgpsmapper installed. How these files were created (Global Mapper or QGIS/GPSFDshp2mp) doesn't matter.
- Download GPSFileDepot's CompileMps.bat batch script to make processing autonomous
- Extract them into the root folder for your map (i.e. mississippitopo)
- Right click on ConvertSplit2mp and click edit (should open in Notepad).
- Modify the following information as required:
- Change the finalmpfolder data to the folder where the final mp files are (normally complete folder)
- If necessary, change cgpsmapperfolder to the folder containing cgpsmapper.exe
- Save the bat file and close Notepad
- Double click CompileMps and let it run. This will call cgpsmapper for each .mp file and convert it to a proper .img file. This will likely take many hours but you can see the progress in the DOS window.
This process will most likely take a few hours and will create .img files. You are now done with the .mp files.
Creating The Preview File
I use MapSetToolkit to easily create the preview files.In the lower left make sure you point the cgpsmapper blank to the location where cgpsmapper is installed.
- Move all the img and all the img.idx files from the complete folder to the release folder
- Open MapSetToolkit
- Make sure the cgpsmapper/cpreview folder is filled in correctly
- Click "Select IMG" in the upper left
- Point it to your release folder
- Click "Select All"
- Click "Add-->"
- Set the Mapset Directory to the release folder
- Enter your mapset name into the mapset name box (Mississippi Topo for example)
- We're going to fill in family ID with a 4 or 5 digit number.
Note: This number can be random but right now GPSFileDepot's maps use 326# and 327#; please don't use any 326# or 327#.
- Leave Product Code blank (it'll automatically fill in with 1)
- Fill in the map version with whatever version you're on and leave CodePage as 1252
- Enter your information into the copyright information box; it may not use this depending on the version of cgpsmapper you use.
- Click Start
Creating Setup Files
We will use NSIS and a template file to easily create setup files that install your maps on someone's computer as well as make it easy to access in BaseCamp or MapSource.
- Download the setup template file. (Updated 15 March 2016 [critical updates])
- Extract the files to your release folder
- Optional: Open license.txt and modify as needed/you see fit.
- Open the .nsi file in notepad
- Edit MAP_DESC_NAME
- Edit MAP_SHORT_NAME (this needs to match the map name from Mapset Toolkit)
- Edit MAP_URL
- Edit MAP_EMAIL
- Edit MAP_COPYRIGHT
- Edit MAP_VERSION
- Edit MAP_REL_DATE (map release date)
- You will need to convert the decimal family id to hexadecimal using Windows' built in calculator. This decimal code is the family id from Mapset Toolkit.
- Open the calculator built in to Microsoft Windows (normally in the Accessories part of the Start menu)
- Click view>scientific (on Windows 10 hit the three lines in the upper left and select Programmer instead of scientific)
- Make sure that "Dec" is clicked (circle filled in or blue in windows 10) and then type in your family id.
- Now click "Hex"; it will return a number (on Windows 10 it will just display the number next to the word HEX). If the number is only 3 digits don't forget to add the zero to the front; for example if the decimal number was 2351 the hexadecimal will display as 92F and in this case we need to make it 092F.
- Now take this code and "flip" it, if the hex code was ABCD then your MAP_ID is CDAB. The flip involves bring the last 2 character and bringing them to the front. In the example above the family id would be 2F09.
- Change the DIRECTORY to match your release directory
- Change the EXE_FILE fromStatetopo_install.exe to XXtopo_install.exe where XX is your state's two letter code.
- Advanced options (do as required/optional):
- If cgpsmapper/MapSetToolkit created a .mdx file uncomment (remove the ; ) line 128.
- If cgpsmapper/MapSetToolkit created .img.idx , .tbd, and _mdr.img then uncomment lines 129 and 134
- This will allow the installer to work with searchable maps.
- If you used custom types uncomment and fill in line 19 and then uncomment line 130
- If you want to have a custom icon for your setup file fill in line 23 and then uncomment lines 40 and 41
- If you want to use a custom left side graphic (as -Oz-'s installers do) then fill in line 24 and uncomment line 47
- Now save the file and close notepad.
- Open NSIS and compile the .nsi file.
NOTE: If you run into an error try moving all the files to a more "root" directory. I use C:\MapTemp and then change line 20 to reflect. Now when you compile it should work.
You should now have a setup exe in your release folder.
Creating Mac Files
This is an optional step but highly recommended.
- Download Garmin MapConverter.
- Start MapConverter
- Click next if it says there are maps that can't be converted.
- Select the map you want to convert and uncheck all the others.
- Click Next.
- Put the file in your release folder
- Click next and let it do the conversion.
- Have it open the folder for you.
- Once you are in the folder we need to zip the file it created. In Windows right click on the .gmapi folder and click Send to > Compressed (zipped) Folder
- Now you are ready to upload the zip file.
You now have a file that can be opened and then installed on a Mac computer.
If you want to make it easier (and have a mac) we highly reccomend you create a setup file for Macs for Garmin compatible maps.
Now that you've made a map make sure you register here at GPSFileDepot and then go to the member's area and add your map so you can share it with the world.
If you have any questions of comments please either contact us or post in the forums.