GPSFileDepot shp2mp Tool
This tool takes ESRI shapefiles (.shp) and converts them to Polish text (.mp) that can be used in GPSMapEdit or converted into Garmin .img files with cgpsmapper. This is GPSFileDepot's modified version of sprok's shp2mp. He released the code under GPLv3 and LGPLv2; GPSFileDepot then used his hard work and made modifications in order to better support map building as done in the tutorials and upgrade the C Shapefiles.
Features (upgrades from the original)
- Allows use of custom dictionary files
- Allows user to set the map ID and map name
- Allows user to select which shapefile column is the type code for cgpsmapper and the name
- Allows user to not include all the columns from the shapefile (saving space)
- Upgraded the internal files to new versions for shapefile reading
Limitations (this and the original): Only works with single part shapefiles. If you see wierd straight lines after processing you have multipart shapefiles. The instructions below can help you.
GPS Sway is for Microsoft Windows only and is run via the DOS command line. Additionally, every input is case sensitive.
- Download just the zip file and extract GPSFDshp2mp.exe into the folder containing the shapefiles you need to convert.
- Open a command prompt (Start and type cmd or shift right click in the file explorer window and select open command prompt here)
- If necessary, go to the folder with GPSFDshp2mp.exe by using the cd command
- Execute the file with GPSFDshp2mp <selected shape layer> <type column> <label column> (<include all columns (default yes)>) (<dictionary file>) (<mapID>) (<map name>)
- Selected shape layer is the shapefile (ex: contours.shp)
- Type column is the column with type information (ex: MP_TYPE)
- Label column is the column with the name of the feature (ex: NAME)
- Optional: include all columns asks if you want all the columns in the shapefile in the polish text file, it defaults to yes, to set it to no put n otherwise put y
- Optional: dictionary file is a custom dictionary file (ex: dictionary_header.mp)
- Optional: set the map ID; this should be an 8 digit number. This option is only available if you are using a custom dictionary.
- Optional: set the map name. If you are naming the map something with spaces don't forget to put quotes " around the name. This option is only available if you are using a custom dictionary.
- Output all columns, a default dictionary: GPSFDshp2mp Elev_Contour.shp MP_TYPE NAME
- Only output the type and name, default dictionary: GPSFDshp2mp Elev_Contour.shp MP_TYPE NAME n
- Only output the type and name, custom dictionary: GPSFDshp2mp Elev_Contour.shp MP_TYPE NAME n dictionary_header.mp
- Output all columns, custom dictionary: GPSFDshp2mp Elev_Contour.shp MP_TYPE NAME y dictionary_header.mp
- Only output the type and name, custom dictionary and custom id: GPSFDshp2mp Elev_Contour.shp MP_TYPE NAME n dictionary_header.mp 12345678
- Only output the type and name, custom dictionary, custom id, custom name: GPSFDshp2mp Elev_Contour.shp MP_TYPE NAME n dictionary_header.mp 12345678 "Test Map"
If you see weird/unexpected straight lines after creating the .mp (check in GPSMapEdit) you likely have a multipart shapefile (can occur with polygon and polyline files). In order to fix this download and install QGIS, and then convert the vector to single part. This can be done by going to Vector > Geometry Tools > Multipart to Singlepart. Once this is done process the new singlepart shapefile.
Current Version: 0.9.8
Production Date: 29 February 2016
The download also provides a sample dictionary_header.mp file that works with GPSFDshp2mp. Of note is the syntax for the ID= and Name= lines; this is what the program looks for.
Source Code/Original Files
The original shp2mp is available at SourceForge.
The C / C++ source code for GPSFDshp2mp is available for download here.
V 0.9.8 - 29 February 2016
- Bug fix: removed dependancy on visual basic dll: msvcp140d.dll
V 0.9.7 - 17 January 2016
- Bug fix: removed hard encoded EndLevel for each element
- Optimization: removed extra info from polygon creation
V 0.9.6 - 17 January 2016
- Added the ability to set the map ID with a custom dictionary
- Added the ability to set a custom map name with a custom dictionary
V 0.9.5 - 9 January 2016
- Initial release
- Improvements from original shp2mp
- updated shapefile handling files
- added the ability to select columns
- better MP_TYPE and NAME handling
- added the ability to have custom dictionary files