Wednesday, January 12, 2011

Creating Custom Topographic Maps for your Hand Held GPS Unit - Part 4

This is Part 4 of a multi-part series on creating custom topographic maps for your hand held mapping GPS unit. For previous posts click one of the following:
Creating Custom Topographic Maps for your Hand Held GPS Unit - Part 1
Creating Custom Topographic Maps for your Hand Held GPS Unit - Part 2
Creating Custom Topographic Maps for your Hand Held GPS Unit - Part 3


Creating Custom Topographic Maps
for your Hand Held GPS Unit - Part 4
Working with GPSMapEdit

In the previous posts we downloaded terrain and water data from the USGS servers (Post #2) and manipulated our terrain data to give us shapefiles containing contour lines at 20', 100' & 200' intervals (Post #3). Now we are going to take those files and assemble them into a .mp map file. (Just a word of warning, this is going to be a rather involved post.) Our goal is to take our downloaded data and assemble it to create something that looks like this:

Now THAT looks like a map!
Continue reading after the jump to start assembling your own map!


If you have used GPSMapEdit before you can skip this section, if not, read on.

If you remember from Post #1 GPSMapEdit does not have an installer with it. Simply unzip the file that you downloaded from Geopainting.com to your C Drive, open the folder and double click on MapEdit.exe.

This is important only if you are using U.S. Units!!
The first time you use GPSMapEdit you need to make sure a few items are set properly. Go to Tools --> Options to open the options dialog panel. Look for and select the Units tab, it should be the upper left hand tab. In this tab change these settings:
  1. Distance, speed set to Statute (feet, statute miles, mph)
  2. Elevation, depth set to Feet
  3. Area set to Square Feet, Square Miles
Your tab should look like this:

A proper set up.

Next I recommend that you create a blank map file and set it up to save time in the future. I already have one created that I named BaseBlankMap.mp. (Click on the file name to download my file, this will allow you to skip the next part.)

GPSMapEdit does not have a "New" function. To create a new map you must import a shapefile or some other compatible object then do a save as. I would recommend  you do the following if you wish to set up your own file:
  1. Go to File --> Import --> ESRI Shape (*.shp) first then navigate to one of your contour .shp files you made with FWTools. Select the file, this will open up the import dialog box. Assign the shapefile an object code (at this point it doesn't matter what), hit the Next button 4 times until the Finish button appears. You should now be able to see the shapefile.
  2. Next go to Tools --> Select Objects and drag a box around all of the contour lines that you just imported. Use the delete key on the key board or go to Edit --> Delete to remove them.
  3. Since GPSMapEdit will not let you save an empty file we must draw something in the file before we save it. Zoom in as far as you can. When the scale in the lower left corner reads 16ft that's your minimum zoom level. To insert a line go to Tools--> Create Object--> Polyline. Left click once, move in any direction just slightly then left click again. Right click and choose End. You will get a dialog box that asks you for an object type; select 0x0000 Roads then click OK. Press Enter to assign the object a blank label.
  4. To save the file go to File --> Save as and set the file type to Polish format (*.mp *.txt) file. Make sure to change the file name before you hit save.
Now we have a "blank" file but we still need to set up some standard properties. These will make the map file transparent and create our different levels so we can filter out information as we zoom out to reduce map clutter.

    1. Go to File--> Map Properties and select the cGpsMapper tab. Make sure that Map is transparent is set to Y - Transparent map without background object. (I have had this setting mysteriously change on me so make sure you double check this setting before exporting your map to an IMG file.)

Check back to this tab before exporting.
    2. Next we will set up our levels. Through some trial and error I have come up with a system of six levels. Go to the Levels tab on the Map Properties dialog box and select the bottom level on the list. Click the Insert Before button until you have levels 0 through 5. Use the Change... button and set the properties for each level as follows:
  • Level 0= 24 Bits | MapSource Zoom= 1 (1.2 -3km)
  • Level 1= 22 Bits | MapSource Zoom= 2 (3 -8km)
  • Level 2= 20 Bits | MapSource Zoom= 3 (8 -12km)
  • Level 3= 19 Bits | MapSource Zoom= 4 (12 -30km)
  • Level 4= 18 Bits | MapSource Zoom= 5 (50 -120km)
  • Level 5= 17 Bits | MapSource Zoom= 6 (120 -300km)


(When adding objects to your map make sure that Level 5 is always empty.)
Click the OK button to exit the Properties dialog then go to File--> Save Map to save.

One last step. We need to add an additional polyline into the drawing on Level 4. Doing this will cause our map to be invisible when zoomed way out on our GPS unit. First, go to View--> Levels--> Level4 4. Next zoom in as far as you can go, just like we did before. Next go to Tools--> Create Object--> Polyline. Left click once, move in any direction just slightly then left click again. Right click and choose End. You will get a dialog box that asks you for an object type; select 0x0000 Roads then click OK. Press Enter to assign the object a blank label. Save your map.

I would then close GPSMapEdit and use windows explorer to navigate to the file and set the file property to Read Only so that you do not accidentally modify this file. Now you really do have a "blank" map template file.


    Ok, now that we have our blank .mp file with our levels set up properly; we are ready to start importing our shapefiles into it. I like to create a map with all of my water data in it first and save it as a MapHydroData.mp file. There are three shapefiles we want to import for water data: NHDArea.shp, NHDFlowline.shp and NHDWaterbody.shp. Locate your downloaded water data zip files (they should be named NHD******.zip) and extract them to an easy to find location. The files we need are all located in the Hydrography folder of your extracted data file. (For instance, if you extracted your NHD******.zip file to a directory called Temp on your C: Drive then the path to the above files would be C:\Temp\NHD******\hydrography\ )

    The NHDArea.shp file contains stream/river and artificial waterway geometry data. This file will give your streams and rivers width on your map so they match what they would look like from the air.

    The NHDFlowline.shp contains most of the data and spatial geometry for streams/rivers and artificial waterways. This file will contain the names of your bodies of water.

    The NHDWaterbody.shp file contains information about lakes and ponds as well as marshes and other water features. This file will contain the names of some of the water features.

    Enough about what the files are, let's import our water data.

    First go back to GPSMapEdit and make sure you have your blank file open. From the drop down menu select File--> Import--> ESRI Shape (*.shp), this will open up the Import dialog box.

    Once you navigate in the dialog box to your hydrography folder, select the NHDArea.shp file and import it.
    • Step 1. Select type of objects: Select the pattern 0x0040 Small lake then select Next>
    • Step 2. Select Source of labels: Find the column labeled GNS_Name and select it, then select Next>
    • Step 3. Assign more attributes: Select Next>
    • Step 4. Select source coordinate system: Make sure WGS84 is chosen, then select Next>
    • Step 5. Select zoom levels to import: Select only levels 0, 1, 2, & 3, then select Finish

    (Do not be alarmed if nothing shows up. GPSMapEdit is filtering the objects out by default do to your zoom level. To display your objects go to View--> Levels--> Level0 0. Every time you import, GPSMapEdit resets the level to Auto.)

    We now need to repeat this step for our flowline data so select the NHDFlowline.shp file and import it.
    • Step 1. Select type of objects: Select the pattern 0x001f River then select Next>
    • Step 2. Select Source of labels: Find the column labeled GNS_Name and select it, then select Next>
    • Step 3. Assign more attributes: Select Next>
    • Step 4. Select source coordinate system: Make sure WGS84 is chosen, then select Next>
    • Step 5. Select zoom levels to import: Select only levels 0, 1, & 2, then select Finish

    Finally we need to import waterbody data. Select the NHDWaterbody.shp file and import it.
    • Step 1. Select type of objects: Select the pattern 0x003e Medium lake then select Next>
    • Step 2. Select Source of labels: Find the column labeled GNS_Name and select it, then select Next>
    • Step 3. Assign more attributes: Select Next>
    • Step 4. Select source coordinate system: Make sure WGS84 is chosen, then select Next>
    • Step 5. Select zoom levels to import: Select only levels 0, 1, & 2, then select Finish>

    To view the water data you just imported go to View--> Levels--> Level0 0.

    Oooh! Water!
    You need to repeat these steps for each NHD******.zip that you downloaded. (Just a word of warning, when importing water data do not use the following patterns: 0x0029 Water, 0x003b Water, or 0x0045 Water as they are not recognized by the Garmin software.)

    Once you have imported all of your water data, save your map, then do a Save As and save another copy under a different name such as MapTopo.mp. This is the file into which we will import our contour lines.

    In your Topo map we will be doing pretty much the same thing as we did with the water data. First we'll import our 20' contour lines which we created in Post #3. From the drop down menu select File--> Import--> ESRI Shape (*.shp), this will open up the Import dialog box.

    Navigate in the dialog box to the output folder containing your ********-20ft.shp (for instance c:\TMP\output\02167919\02167919-20ft.shp), select the ********-20ft.shp file and import it.
    • Step 1. Select type of objects: Select the pattern 0x0020 Minor land contour (1/10) then select Next>
    • Step 2. Select Source of labels: uncheck the Select field for labels box, then select Next>
    • Step 3. Assign more attributes: Select Next>
    • Step 4. Select source coordinate system: Make sure WGS84 is chosen, then select Next>
    • Step 5. Select zoom levels to import: Select only levels 0, & 1, then select Finish

    We now need to repeat this step for our 100' contours so select the ********-100ft.shp file and import it.
    • Step 1. Select type of objects: Select the pattern 0x0021 Interm. land contour (1/2) then select Next>
    • Step 2. Select Source of labels: Select the elev field, then select Next>
    • Step 3. Assign more attributes: Select Next>
    • Step 4. Select source coordinate system: Make sure WGS84 is chosen, then select Next>
    • Step 5. Select zoom levels to import: Select only levels 0, 1, & 2, then select Finish

    We now need to repeat this step for our 200' contours so select the ********-200ft.shp file and import it.
    • Step 1. Select type of objects: Select the pattern 0x0022 Major land contour (1/1) then select Next>
    • Step 2. Select Source of labels: Select the elev field, then select Next>
    • Step 3. Assign more attributes: Select Next>
    • Step 4. Select source coordinate system: Make sure WGS84 is chosen, then select Next>
    • Step 5. Select zoom levels to import: Select only levels 0, 1, 2, & 3, then select Finish

    Go ahead an repeat the above steps for each set of topographic data that you downloaded from the USGS. After you are finished save your map. It should look pretty similar to the following:

    Getting close!
     Just a few more steps and we are done! As you can see from the image above, your map will have quite a bit of water data outside of  your area of interest. To trim this data choose the Trim Map tool from the toolbar or go to Tools--> Trim Map. Draw a box around your contour lines then right click and choose Trim Outside. Next go to Tools--> Remove object duplicates. It will bring up a dialog box telling you how many duplicate objects have been deleted. Click OK then save your map.

    The finished product.
    That's pretty much it for assembling the map. In the next post we'll set up the .mp file and process it with cGPSMapper to convert it into a Garmin compatible .img file. Then we'll use MapSetToolkit to import our .img file into Map Source so it can be loaded into our GPS unit!

    Until next time, take care and be safe.

    ~Occasional Hyker

    No comments:

    Post a Comment

    Feel free to leave a comment. Please do not leave any obscene, profane, pornographic, incorrigible, rude, crude, very off-color, hate filled, flame war inducing, nihilistic, holistic, racist, sexist, ageist, or any other kind of -ist message. Any comments containing any of the above elements will be deleted, unless I find them particularly funny.

    Thank you,
    The Management