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)

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.

Installation/Instructions

GPS Sway is for Microsoft Windows only and is run via the DOS command line. Additionally, every input is case sensitive.

  1. Download just the zip file and extract GPSFDshp2mp.exe into the folder containing the shapefiles you need to convert.
  2. Open a command prompt (Start and type cmd or shift right click in the file explorer window and select open command prompt here)
  3. If necessary, go to the folder with GPSFDshp2mp.exe by using the cd command
  4. 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.
    • Examples:
      • 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.

Download

Current Version: 0.9.8
Production Date: 29 February 2016

Download GPSFDshp2mp

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.

Change Log

V 0.9.8 - 29 February 2016

V 0.9.7 - 17 January 2016

V 0.9.6 - 17 January 2016

V 0.9.5 - 9 January 2016