MPRouteReader Guided Tour: Creating routes from sub-groups of pushpins
MPRouteReader creates a route from an existing pushpin set, sorting the waypoints (pushpins) according to a sequence datafield. MPRouteReader also has the ability to create the route from a subset of the pushpins in the pushpin set. These subsets are called groups.
Grouping Pushpins into Routes
This example uses a single pushpin set that describes two routes. The two routes share the same start and end location. Storing them together like this saves time because they can be loaded into MapPoint with only one run of the Data Import Wizard. It can also simplify the data generation. For example, if the route waypoints are ultimately coming from a database, they can all be extracted from the database in one batch run.
The sample data is illustrated in the spreadsheet on the right. This is like a conventional MPRouteReader spreadsheet, but it includes a new column called Group. This specifies the group (route) assignment for each location in the spreadsheet. Stops are either in group 'A' or group 'B'. The first location has its own group called 'home'. We will set the routes to start and stop at this location. The column is loaded as a data field into the pushpin set, as usual.
Here is the same data loaded into MapPoint as a conventional pushpin set. Notice that all the pushpins are loaded, although our final route will only use a subset of these pushpins.
We are now ready to create a route from this pushpin data. We shall create a route from group A, and use the home (sequence 1) location as our route start and end point.
The screenshot to the right shows how to set MPRouteReader to do this. The pushpin set and Waypoint Order are set as before. This time we check the Restrict waypoints to a group check box, to indicate that we wish to use a specific group of pushpins from the selected pushpin set. RouteReader will fill the group options out when you set this check box. Select the name of the group data field (Group in this example) in the Data field containing the group names list box. Then select the required group (A in this example) from the Choose the required group(s) list. You can select multiple groups if you wish to combine route segments into a larger route.
It is also possible to select specific pushpins for the start and/or end locations. This is useful if you want your routes to start and/or finish at the same location (eg. a factory or sales office). Simply check the Set Start Waypoint and Set End Waypoint check boxes, and select the required group(s) for the start and end points. Typically these locations are described using special groups that have one special pushpin (home in this example).
MPRouteWriter v3 adds support for multiple pushpins in the start or end group - these are simply sorted according to the current waypoint order and then added to the start or end of the route.
Here is the final route. Note that the route only uses those pushpins specified in group A and it starts and ends at the group home location. All waypoints have been sorted by the sequence number, with the exception of the start and end locations which were explicitly specified as being the home location.
Next, we look at pushpins that are in multiple groups (and routes).