Tuesday, February 28, 2006

Street Navigation and Routing in GTViewer using MapPoint

Street Navigation and Routing capabilities are common tasks required by many GTViewer users. In its simplest definition, Street Navigation is determining a list of directions to get from Point A to Point B where Points A and B are street addresses (such as 123 Main St., Anytown, AL). Directions are presented as a list of turns and distances to travel to get you from the starting address to the destination. Street Routing is a step of above Street Navigation, while the two tasks are similar, Street Routing takes a list of addresses and finds the best order to visit each address providing the optimal (or near optimal) list of directions that minimize the distance and time required to visit all addresses.

While most GIS data does provide extensive landbase information (roads edges, street center-lines, etc.), this data generally does not provide enough information to perform viable Street Navigation or Street Routing. Many datasets even have well connected street centerline data, but do not contain one-way street information, road class, construction information, or any number of other attributes that could affect navigation decisions. So, the question arises, do you want to try to use your GIS’s landbase information even though it does not contain sufficient information to perform usable navigation and routing, or do you look to a 3rd party source of data to help? More and more users are turning to 3rd party data to solve this problem. Detailed street data that contains enough information to provide navigation and routing is very difficult to create and even more difficult to maintain. However, 3rd party data is available for these specific tasks. Microsoft’s MapPoint application is one such source of this data and is the topic of today’s blog posting. MapPoint provides good street data, good routing tools, and can be easily integrated into other applications (in this case, GTViewer).

MapPoint provides an extensive API for accessing its functionality. Similarly, GTViewer provides a similar style of API for extending its own functionality and integrating it with other applications. By creating an external application for GTViewer, the MapPoint functionality can be embedded into GTViewer and the MapPoint functionality becomes accessible inside GTViewer. One might ask the question, why bother integrating this functionality into GTViewer when MapPoint itself provides a user-friendly interface for performing Street Navigation and Routing (plus much more). An overwhelming opinion on this matter is that users do not want to switch to a different application to do this, user do not want to be trained on another application, and MapPoint’s many features that are not applicable may be confusing to the user. Also, running MapPoint as a separate application forgoes the tight integration you can achieve by embedding MapPoint inside GTViewer, such as clicking on a feature in GTViewer’s view to obtain an address for MapPoint to use, or clicking on an address in MapPoint and locate on it in GTViewer.

A Street Routing application is now available for GTViewer. This application integrates MapPoint with GTViewer to provide Street Navigation and Street Routing to GTViewer users. With the Street Routing application installed, you can select it from the Query menu in GTViewer and get the following dialog:



The Street Routing dialog provides three 3 methods for entering an address. The first, Find Place or Address, allows the user to key in a complete address, such as 123 Main St. Anytown, Alabama. Pressing the Find button will then search the MapPoint database for any matching address and present them to the user. The second method, Find Address, allows the user to enter the address components (Street Name, City, State, Zip Code). Pressing the Find button will search the MapPoint database and present any matching addresses:






The third method is the Get Address from Map option which allows an address to be acquired directly from a feature in GTViewer. Pressing this button activates a mode in GTViewer that allows the user to select features with addresses (the feature list must be configured in advance along with the table and fields that contain the address information). Once a feature containing an address is selected in GTViewer, the address information is sent directly to the Street Routing application.

Select and Address in GTViewer:






If the selected address is found, it is located in the MapPoint view and automatically added to the Route.



To perform Street Navigation, you need at least two addresses in the Route List. Any address in the Matching Addresses list can be added to the Route List (by double-clicking or pressing the Add button). The Delete button can also be used to remove any selected address from the Route List. The first address in the Route list is always the starting point and the last item in the list is the destination. You can have any number of items in the Route List. The Move Up and Move Down buttons can be used to reorder the items in the Route List while the Clear Route button will reset the list.

The Compute Route button is enabled when 2 or more items appear in the Route List. Pressing this button will cause MapPoint to generate a directions list to navigate from the starting address, through any intermediate addresses (waypoints), to the destination address.

In the following example, 4 addresses appear in the Route List:



A closer view of the graphical representation of the directions is shown below. The numbered squares correspond to the items in the Route List:



The Directions List provides summary information of the trip along with a detailed turn-by-turn description of how to get from the starting address, through the waypoints, to the destination address:



If a Route List has 4 or more addresses, you also have the option to Optimize the route. The Starting Address and Destination Address will stay the same, but any waypoints will be ordered such that you have the best route for the given address list.

In the trivial example shown above, Optimize still reduces the distance and driving time by change the order of the waypoints:





For more complex routes that cover a larger distance, the optimization can make a dramatic reduction in both time and distance. Optimizing a route is a non-trival problem that MapPoint handles automatically.

A more complex route is show below with a estimated travel time of 30 minutes and a distance of 13.4 miles:



Original Route List


Optimizing the route reduces the estimated travel time to 16 minutes (almost half the original) and a travel distance of 6.9 miles.


Optimized Route List


The Street Routing app has a few other features as well. Clicking on any address in the Route List will locate on that item in both the MapPoint view and in GTViewer. There is also an Import and Export capability for the Routes. So, if you have a file that contains a list of addresses (this file can be created in various ways from manually typing in a list with notepad or from an outage system’s output), press the Import Route button, select the file, then optimized and create a direction list. You can also export any Route list to a file with the Export Route button.

All GTViewer users do not need Street Navigation and Street Routing capabilities, so the additional cost of MapPoint is not justified; however, there are always times when this functionality is crucial to your operation, such as when visiting crews are helping with storm damage and are unfamiliar with the area. Using an application dedicated to Street Navigation and Routing, like MapPoint, is generally a better solution than trying to force your existing GIS’s landbase data to work at a crippled or inadequate level. By integrating MapPoint with GTViewer you get the best of both worlds.

No comments: