spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2009
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2009

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
ViaVirtualEarth
SVG Tutorials
MapPoint

Map Visitors

 Direct Media

Travel Insurance Compare over 450 travel insurance policies (inc. annual multi-trip, single trip & winter sports)

  ARTICLES  


Roll Your Own Commercial Routing System with MapPoint

Matt Fritz shares his experience developing a routing application including discussion of MapPoint's strengths and limitations. The articles includes several screenshots illustrating the various components of the routing application.

 

Everyone is familiar with vehicle routing from point A to point B, perhaps applying additional criteria like ‘highway or scenic’, routing around known construction areas, and perhaps inserting a stop (waypoint) or two along the way. But suppose you needed to route 100 vehicles to 3000 locations where the list of locations changed daily, many locations had a ‘time window’ dictating an acceptable arrival time, the amount of time spent at each waypoint varied, and the total duration of each route needed to be no less than 8 hours but no more than 8 ½ hours.

Commercial vehicle routing adds a bit more complexity to the routing problem. Solving this problem through software as been the elusive brass ring, in part because there is no ‘right’ answer – only a set of ‘best compromises’. Commercial routing systems usually offer a toolbox rather than a black box solution, (regardless of marketing claims to the contrary). Commercial routing is often a partnership of tools and human intervention.

MapPoint 2006 offers many of the core tools needed for this kind of routing – many but not all. That’s no surprise because MapPoint has been built and promoted more as a business intelligence tool to render graphic representations of business data. For example MapPoint 2006 doesn’t support multiple concurrent route creation from a pool of thousands of waypoints or routing around streets and highways designated ‘no commercial traffic’. (You can solve these issues on your own (kind of) but they’re not supported out of the box. Let’s see what the next version brings).

When charged with writing a commercial routing system for a wholesale distributor I employed the MapPoint 2006 map control and extensive API into a VB.NET application. This enables the application to deliver core routing functionality, including:

* Geocoding – automatic address matching and manual locating
* Calculating route/stop distance and duration – estimated arrival/departure times
* Performing ‘perimeter searches’
* Employing custom pushpin icons to indicate customer delivery criteria at-a-glance
* Employing pushpin balloons to display order information at-a-glance
* Providing a good map experience at low cost

Note for this application the routes are not created by MapPoint but rather using a collection of drag/n drop tools. MapPoint is then employed to calculate data about the route and display routed and un-routed customers on a map.

Batch Geocoding Customer Addresses with MapPoint and Other Sources

The foundation of any routing system is accurate geocoding. The quality of customer address data can be anything from ‘OK’ to dismal (rarely is it good) and address matching itself is part science – part fuzzy logic. When attempting to geocode many thousands of customers at one time (like for an initial data load) the results can be disappointing and even misleading. MapPoint returns a ‘result quality’ value to rate the result of an address match but even a high confidence result doesn’t mean you’ll like every location it chooses. Manually confirming the locations chosen by MapPoint for 10,000 locations would be an arduous and error-prone task.

For our initial batch geocoding of all customer addresses we opted to use an on-line geocoding service from Tele Atlas called EZ-Locate. It also returns a ‘results quality’ for each match plus the lat/long. We accepted the lat/long into our database for all results with the highest result quality value.  (We experienced a 90% percent good match rate – your mileage may vary). All others where flagged as ‘not geocoded’ for the end-users to manually locate using our routing application with embedded MapPoint tools. The manual process took less time than anticipated and served as a good learning exercise for the end-users.

Geocoding New Customers with MapPoint

New customers are initially flagged as ‘not geocoded’ which tells the routing software to geocode them using the MapPoint API. Again the application automatically accepts high quality results and leaves remaining customers flagged as not geocoded for the end-users. The difference here is the small number of new accounts each day which makes it easy to verify or manually locate.

Manually Locating / Relocating and Updating DatabaseLat/Long

Geocoded Customer Records with Lat/Long and GeocodingSource

A Proximity Search Function (Who’s Nearby) Helps with Manual Geocoding

Route Creation 

The routes are manually created using drag/n drop tools. Once created the route locations (route start, route end, and waypoints), and the waypoint duration times are passed to MapPoint – not to change the sequence of waypoints but rather to generate data about the route passed to it, including arrival times, mileage, and total route time, including to and from the warehouse depot (the real first and last stop).

We couldn’t let MapPoint create the actual route for several reasons including lack of support for roads designated ‘no commercial traffic’. However this turns out to be a non-issue because the distance and elapsed time between two locations is approximately the same regardless of which streets are used. Considering other unknowns like traffic and weather makes the whole issue moot. Arrival times are approximate.

MapPoint Waypoint Arrival Times and Mileage Calculations

Business Intelligence

Commercial routing and related data like customers and sales can generate tons of historical data and MapPoint is a great BI tool to render that data on a map. My application didn’t take advantage of MapPoint’s BI abilities but yours can, including combining your business data with demographic data from MapPoint and third party sources. An image can be worth a thousand reports to logistics, sales, and other interested parties. (The image below property of Microsoft).

Summary

Commercial vehicle routing is an interesting and complex task that is usually supported by commercially-available packages but it’s possible to write your own system customized to your needs. MapPoint can provide invaluable functional support and professional polish at a very reasonable cost. There’s nothing to it but to do it!

Discuss this story in the forum.

Author: Matt Fritz
Email: mfritz2020@yahoo.com
Matt Fritz is a working .NET developer and applications manager with a lifetime of experience in wholesale distribution. He can be reached at mfritz2020@yahoo.com.



Google
 
MP2Kmag Internet


 Recent Discussion
-Bing Maps Book in French
-Oval adjustments access denied
-bingmaps: RT @BingMapsDev: Great new book in French on Bing Maps from @NicolasBoonaert http://bit.ly/ba72nc
-Bing Maps Powers The National Grid
-New Bing Maps Book Helps Developers
-bingmaps: Visit #bingmaps explore site http://bit.ly/cjMOBf and hit map apps to get a different view of the Vancouver winter Olympics
-Help with Spatial Data/Table. Sql add-in Mappoint
-Matching by Zip Code
-Another Big Imagery Release for Bing Maps
-BingMapsDev: @csharpzealot and the 2.3GB download begins ;)
-BingMapsDev: Great new book in French on Bing Maps from @NicolasBoonaert http://bit.ly/ba72nc
-bingmaps: MapDotNet's entry to Azure US State and Local Government Application Development Contest with Bing Maps: http://miami311.cloudapp.net/
-Ability to change color of state lines?
-bingmaps: @chrispendleton on stage right now at TechDays in Paris. Presenting #BingMaps
-route directions????
-bingmaps: Interested in the rare trees of London? View them in this #BingMaps collection http://bit.ly/chOLp9
-MapPoint in Desktop Applications
-Varying travelling time by "time of day"
-Link using parameter query in Access, still no?
-Can I see a list of all pushpins?
-Assigning pushpins as territories
-Displaying info in the directions for a route
-Drive time polygons - help needed
-2002 Loading Help
-bingmaps: Webcast 10th Feb: #BingMaps ? Getting Started for Developers. Presented by @johanneskebeck http://bit.ly/8XhzCC
 Resources
Browse GIS books and periodicals
Best Car Contract Hire Lease Save
Find a MapPoint Partner or Consultant
Real Estate Columbia For Sale By Owner


Want Your Site To Appear Here?

   © 1999-2009 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009 are either trademarks or registered trademarks of Microsoft.

• Replacement Cordless Phone Batteries from DSMiller
Improve your career with a computer degree LocalEDU.com
• Tim Cohn's Marketing Strategy Consultancy
• Buy Toner Cartridges at Marquee Office Solutions
• Looking for Dry Erase Boards? See Dry Erase Boards • The Search Starts Here Used Cars
• 5339 - We Know Bikes: Road Bikes / Triathlon Bikes / Mountain Bikes / BMX Bikes
• Buy Your Car Used Cars UK, Car Lease and Contract Hire