Vietnamese GPS - Intelligent on the go

Mapmaker Getting Started

Tutorial 3a – Routing

Goals for this section

            - Understanding Routing

            - Use GM8 to insert vertices at intersections

            - Export .MP file to GPSMapEdit (GME)

            - Create routing data in GPSMapEdit

            - Use the Search feature in GM8 to edit multiple features simultaneously

Some Garmin GPS receivers have the ability to calculate routes from your current location to your destination, then provide turn guidance along the calculated route. If your GPSr has this capability, then you can create routable maps with cGPSMapper’s Personal version. A free 30-day trial is available at

 http://cgpsmapper.com/buy.htm#personal

Routable maps have additional data associated with the road object declarations, indicating the speed limit, the class of road, and specific restrictions such as toll or one-way.

Currently, GM8 does not have the ability to edit all of these routing attributes, so we will use another program to help us with generating the routing information. GM8 is still a very important part of creating routable maps, as you will see.

How Routing Works

Each routable road has associated information describing its routing characteristics. Each intersection between routable roads is called a Routing Node. Calculating a route in the GPSr is simply a matter of looking at where you are, where you want to go, and evaluating the available paths to generate the best route within your defined road grid, according to your preferences.

This map fragment, grabbed from a GPSMapEdit screen, has four routable intersections indicated by the small rectangles at the intersections. The yellow rectangles (NW, NE and SE) indicate two roads meeting at the intersection, and the green rectangle (SW) indicates three roads meeting at the intersection.



Let’s explore the Polish format source code underlying this map.

All of these routing attributes have been added by GPSMapEdit; we’re simply going to take a look to understand what’s going on inside the data file when routing information is present. I’ve reformatted the coordinates to make it easier to see the relationships between vertices used as NodeIDs, and added comments to the side explaining the meaning of the Nodx= declarations.

[RGN40]
Type=0x2
Label=89
Levels=2
RoadID=1
Data0=
(43.474510,-110.781707), ; <- 0th node
(43.474975,-110.777572),
(43.475101,-110.776176),
(43.475505,-110.774711),
(43.477554,-110.771392),
(43.478736,-110.769744),
(43.479419,-110.768470),
(43.479576,-110.768066),
(43.479671,-110.767440),
(43.479671,-110.762313), ; <-9th node
(43.480369,-110.762313), ; <-10th node
(43.488754,-110.762374),
(43.490890,-110.761878),
(43.495021,-110.760543)
Nod1=9,5,0 ; <- 9th node connected to NodeID 5 (Broadway & Cache)
Nod2=10,4,0 ; <- 10th node connected to NodeID 4 (Deloney)
[END-RGN40]

[RGN40]
Type=0x6
Label=BROADWAY
Levels=1
RoadID=2
Data0=
(43.479671,-110.762313), ; <- 0th node
(43.479660,-110.761261), ; <- 1st node
(43.479606,-110.756889),
(43.479724,-110.754425),
(43.479724,-110.752273),
(43.479724,-110.749900),
(43.479763,-110.743186)
Nod1=0,5,0 ; <- 0th node connected to NodeID 5 (89 & Cache)
Nod2=1,2,0 ; <- 1st node of Broadway connected to NodeID 2 (Center)
[END-RGN40]

[RGN40]
Type=0x6
Label=CACHE
Levels=1
RoadID=3
Data0=
(43.479671,-110.762313), ; <- 0th node
(43.471702,-110.762336)
Nod1=0,5,0 ; <- 0th node connected to NodeID 5 (89 & Broadway)
[END-RGN40]

[RGN40]
Type=0x6
Label=DELONEY AVE
Levels=1
RoadID=4
Data0=
(43.480381,-110.767250),
(43.480369,-110.762313), ; <- 1st node
(43.480365,-110.761261), ; <- 2nd node
(43.480342,-110.753021)
Nod1=1,4,0 ; <- 1st node connected to NodeID 4 (89)
Nod2=2,3,0 ; <- 2nd node connected to NodeID 3 (Center)
[END-RGN40]

[RGN40]
Type=0x6
Label=CENTER ST
Levels=1
RoadID=5
Data0=
(43.479660,-110.761261), ; <- 0th node
(43.480365,-110.761261), ; <- 1st node
(43.481895,-110.761245)
Nod1=0,2,0 ; <- 0th node connected to NodeID 2 (Broadway)
Nod2=1,3,0 ; <- 1st node connected to NodeID 3 (Deloney)
[END-RGN40]

First, an explanation of the Nodx= declaration.

Nodx= <This road’s zero-based coordinate pair reference>, <NodeID>, <External (1|0)>

The first number represents the offset of the referenced coordinate pair, counting from 0. The second number is the NodeID. Any other Nodx= declarations with the same NodeID in this position share an intersection with this Nodx= declaration. The third number says whether or node this node is external, meaning that other maps can link to this map at this node. Its value can be 1 or 0.

For an example, let’s look at the Nod2= declaration for DELONEY AVE and the Nod2= declaration for CENTER ST. These two statements share a reference to NodeID 3, creating the routable intersection of these two streets.

DELONEY AVE CENTER ST
Nod2=2,3,0 Nod2=1,3,0
(43.480365,-110.761261) (43.480365,-110.761261)

The second routing node from DELONEY AVE (Nod2=2,3,0) tells us that the second coordinate pair of this road (counting from 0) is a member of the NodeID 3 intersection, and that this is not an external routing node.

The second routing node from CENTER ST (Nod2=1,3,0) tells us that the first coordinate pair of this road (counting from 0) is a member of the NodeID 3 intersection, and that this is not an external routing node.

Notice that the referenced coordinate pairs are identical, as they must be for routing to work. GPSMapEdit will not create a routable node unless there are matching vertices at the intersection of the two roads.

Now let’s look at the intersection defined by NodeID 5, with three intersecting roads.


89 BROADWAY CACHE
Nod1=9,5,0 Nod1=0,5,0 Nod1=0,5,0
(43.479671,-110.762313) (43.479671,-110.762313) (43.479671,-110.762313)

Again, note that the coordinate pairs for this intersection are identical.

At compile time, cGPSMapper looks through the .MP file for all Nodx= statements, grouping those with matching Node IDs, and creating the routable road data structure that your GPSr scans when calculating a route.

Understanding RouteParam=

In addition to declaring the routable road intersections, we also need to declare attributes for the individual roads describing the Speed Limit, and Road Class characteristics. In Polish format, this is done with a RouteParam= declaration:

RouteParam=<Speed>,<Road Class>,<restrictions…>

Here is a table showing the possible values of RouteParam= for Speed and Road Class, the two most important parameters:

Speed

Road Class

Parameter

MPH

KPH

Parameter

Road Types

0

3

5

0

Street/Alley/Unpaved

1

15

20

1

Collector/Roundabout

2

25

40

2

Arterial/Minor highway

3

35

60

3

Principal highway

4

50

80

4

Major highway/ramp

5

60

90

6

70

110

7

The Speed parameter is used when calculating the fastest route and projected arrival time. The Road Class attributed is used to select the path of least resistance through an area. Higher numbers mean more desirable routing.

Creating Routing Nodes

Now we’re going to create the data that we’ve been studying here.

Launch GPSMapEdit, and open Jackson WY.MP. Press the Z key to enter Zoom mode, then drag a box around the center of town.

Press the M key to enter the Edit Nodes mode, then click Highway 89 so that it is selected. Right-click at the intersection of 89, Broadway and Cache, then select Connect to Nearest Nodes.



This creates a routing node at the intersection of 89, Broadway and Cache. The resulting node should be green, indicating a 3-street intersection. When we created this intersection in GM8, it was an origin point for each of the roads, so there are already vertices at this location to connect. GPSMapEdit shows vertices as ‘X’s. Note that there are no vertices at the intersection of 89 and DELONEY, just north of our 3-street intersection. GPSMapEdit requires vertices in both intersecting roads at any location intended to become a routing node.

Right-click at the intersection of 89 and DELONEY, and note that there is no option to Connect to Nearest Nodes. We need to add vertices at the intersection of these roads.

With Highway 89 still selected, position the cursor at the intersection of 89 and DELONEY. Right-click, then select Add Node Here. Click on DELONEY, position the cursor at the same intersection, then right-click and select Add Node Here. Depending upon how accurate you were with your clicking, you may or may not have a right-click option to Connect to Nearest Nodes at this intersection. I usually have to drag one of the vertices towards the other until it lights up red, indicating that they’re aligned before I can use Connect to Nearest Nodes.

As you can see, this process will get tedious very quickly! Fortunately, GM8 can help us out.

Close GPSMapEdit without saving any of your edits, and return to GM8. Use the Overlay Control Center to hide all but the User Created Features overlay. Press Alt+D to enter Edit Mode, press Home to show your entire map.

Click Tools | Configure… (or the Configure icon in the toolbar) then click the Vector Display tab. In the Select From section, select only Lines, then click OK. Drag over your entire map so that all the roads are selected. Press Shift+V to toggle vertex display so that vertices are visible. Right-click anywhere, then select Insert Vertices at Intersections of Selected Features. Note that GM8 has created coincident vertices at all road intersections for us.

Press Esc to unselect the roads. Let’s use this opportunity to do a little clean up on some Areas.

Click the Configure icon in the tool bar to open the Configuration dialog, then click the Vector Display tab. Select only Areas, then exit the Configuration dialog.

Press Alt+Z to enter Zoom Mode, then drag over Miller Park. Press Alt+D to enter Edit Mode, then click near a corner of the park area such that the vertex is highlighted. Right-click and select Move Selected Vertex. Click and drag the vertex so that it snaps to the road intersection. Repeat for all four corners, then repeat for the Fairgrounds and the Town Square. When you’re finished tidying up, open the Vector Display tab in the Configuration dialog to restore the checkboxes for Areas, Lines and Points. Press Ctrl+S to save your workspace.

Export your Polish format file, overwriting the previous copy. Open this file in GPSMapEdit.

Press the M key to enter Edit Nodes mode, and click on Highway 89. Note that there is now a vertex at the DELONEY intersection. Click on DELONEY, and notice an identical vertex at that intersection. This map is ready for routing nodes.

In the GPSMapEdit menu, click Tools | Generate Routing Nodes | At Coinciding Points of Polylines. This automatically creates routing nodes at all intersections. The blue nodes are created at the ends of roads - don’t worry about them. Check your map to make sure that all intersections are at least yellow, and not blue. If you see blue at an intersection, it probably means that the one of the roads terminates just shy of the intersection. Press M to Edit Nodes, then click and drag the vertex to align it with the other, then right-click to Connect Nodes.


Rectangle Color Meaning
Blue Routing node, no intersection
Yellow Intersection of 2 roads
Green Intersection of 3 roads
Purple Intersection of 4 or more roads
Red Routing node with errors
Red border Node has turn restrictions
Large node Node is external

Now let’s take a look at how GPSMapEdit assigned Speed and Route class attributes. In GPSMapEdit, press the S key to Select Objects, then double-click on Highway 89 to bring up the Object Properties dialog, then click the Routing tab.



GPSMapEdit assigned a default speed of 60mph, which is too fast for this segment through town. In the Speed limit dropdown, select (3) 35 MPH / 60 KPH. Click OK to accept the parameters and dismiss the Object Properties dialog.

Now double-click BROADWAY, and adjust its parameters to Speed limit (2) and Road class (2).



Click OK to accept the parameter changes and dismiss the dialog. Apply the same settings for CACHE. We now have the most important streets in town designated as Principal HW or Arterial. Let’s take a look at the other streets to see what RouteParam= attributes have been assigned.

Double-click Pearl, and note that it has a Speed limit of (3) and a Route class of (0). That’s probably too fast for a city street. All of the other city streets will be the same. We’ll use GM8’s powerful Search feature to edit all of the city street attributes simultaneously.

Save the file in GPSMapEdit by pressing Ctrl+S, then exit.

Now we need reload our Polish format file that’s been edited in GPSMapEdit. Our workspace already has a representation of the roads in our USER CREATED FEATURES overlay, but we now want to work with our edited version. First, save your current JACKSON WY.GMW workspace just in case you want to come back to your original data.

Open the Overlay Control Center, select USER CREATED FEATURES, then Close Overlay.

Press Ctrl+O to Open File, and open JACKSON WY.MP – the updated vector feature file that was just saved by GPSMapEdit. Click File | Save Workspace As …, and save this workspace as JACKSON WY IMPORT.GMW. This version of the workspace will use the imported .MP file with our edits.

Press Home so you can see the entire project. We’re now going to use the Search feature to find all roads whose RouteParam= attributes begin with 3,0 – in other words, those roads for which GPSMapEdit set a speed limit of 35.

In the menu bar, click Search | Search by Attributes, Name, and Description.

In Types to Search, click ‘Lines’. In Search Criteria – Attribute/Item, select ROUTEPARAM from the drop-down list. Select ‘=’ from the comparison type list, and ‘3,0*’ as the Compare value. This will find all lines whose RouteParam= attribute begins with 3,0.



This is exactly the group of roads we’re looking for. Click ‘Select All’, then ‘Edit Selected’.



In the Modify Selected Line Feature dialog, select RouteParam from the Feature Attributes drop-down list, then click Edit. Change the initial 3 to a 2, representing a 25mph speed limit for city streets. Close all open dialogs and return to the GM8 main screen.

Note: Beginning with version 1.0.32.0 of GPSMapEdit, it is possible to simultaneously change the Speed and Route class parameters for a group of selected roads. This section of the tutorial was designed to introduce the powerful Search/Modify features of GM8.

Now we’ll export our modified road database plus the topo contours. Open the Overlay Control Center, display the GENERATED CONTOURS overlay, then close the Overlay Control Center.

Export the visible vector overlays as JACKSON WY.MP. Note that we have now merged our two vector overlays into a single overlay.

Compile and download your map to your GPSr.

This concludes the introductory tutorial sequence.

Tutorial 4a – The Development Cycle

To continue developing your map, you need to be aware of a few key concepts to keep everything in order.

Only vector data can be compiled and downloaded into a GPSr. In these tutorials, we combined the digitized features that you created manually with GENERATED CONTOURS. If you want to remove or exclude vector features from your export, you can easily do so by using the filter functions of GM8. You will find that GM8 is very flexible in its ability to manipulate your database.

If you want to edit your .MP Polish format source files outside of GM8, you need to follow a simple sequence to keep things in order.

When you are ready to work on your source file outside of GM8, export it as a .MP Polish format file.

Edit the file as needed in your external tool, saving it again in .MP format.

When you are ready to re-import the modified file to GM8, open your saved workspace, and Close the older version of your data in the Overlay Control Center. This removes the old version from your workspace. Use the Open Data File(s) command to re-import your new file, reintegrating it into your workspace.

Have fun!

Additional Online Resources

Global Mapper Tech Support Group

http://tech.groups.yahoo.com/group/global_mapper/

cGPSMapper Tech Support Group

http://tech.groups.yahoo.com/group/map_authors/

GPS Passion Forum

http://www.gpspassion.com/forumsen/default.asp


Search your city map:

 
Web www.digitalmobilemap.com