External Map Applications

From CTMS

Drive Time and Distance Calculation using External Map Application

When a customer needs to deliver to new locations on a regular basis, there needs to be a method by which C-TMS can gain reasonably accurate drive times and distances for the journey legs that it creates. There are other methods that already exist within C-TMS, such as Pythagoras and Time & Distance Matrix: -

  • Pythagoras - calculating the distance using Pythagoras (plus a wiggle factor) then using an average speed to calculate the drive time. Note that the distance unit, i.e. miles or kilometers, is determined by the system parameter GEO_DT_DISTANCE_UNITS which is configured by the superuser in conjunction with the C-TMS Application Team.
  • Time & Distance Matrix – a matrix of times and distances, held in a table, which needs to be pre-populated using the output from another system (such as Paragon Routing).

By introducing NAVTEQ or MapPoint the following C-TMS functionality is made available:

  • NAVTEQ or MapPoint allow for Times and Distances to be generated on the fly, by passing in the source and destination long/lat coordinates, and then calculating the journey based on a road network using various road speeds depending on the class of road used.

In summary, the functional process is as follows (using MapPoint as an example):

  1. C-TMS “Get Time and Distance” function is called when the drive time and distance is required between two trip stop locations (a journey leg), such as when pressing a “Calc Dist & Time” button.
  2. A request is queued to the MapPoint Interface program (named “CBDS Interface”). The request simply includes the data that the CBDS Interface program needs to calculate drive time and distance using MapPoint, such as location latitude and longitude (lat/Long) of each location.
  3. The queued request is picked up by the CBDS Interface which then initiates a background MapPoint “session”. The lat/long of the two locations is used to pin-point the journey leg locations on a MapPoint map.
  4. Once the two locations are pin-pointed on the map, a route is created between the two. The route follows the road network and considers the parameters configured in the CBDS Interface, such as whether to use KM or Miles and Road Speeds.
  5. Once the route is complete, the Distance and Drive Time are returned from MapPoint to the CBDS Interface program. The CBDS Interface program then updates the C-TMS Trip Stops with the calculated data and marks the request as processed.
  6. The end-to-end process typically takes a second or so and usually occurs in real time.

Latitude/Longitude Calculation using External Map Application

To achieve the best distance and drive time results using MapPoint, each location on a journey leg should have both latitude and longitude. This ensures that each location can be pin-pointed in an external map application without ambiguity. However, in some cases locations will be provided without latitude and longitude (lat/long). In such situations the lat/long must be calculated when the location is created in C-TMS. Once the lat/long has been applied to the location, the standard process of calculating distance and drive time by lat/long can be followed. MapPoint can be used to calculate the lat/long for a location as long as the necessary address data is available for the location to be pin-pointed in MapPoint. The full set of address information is as follows:

  • Street
  • City
  • Other City (within the UK, such as a village within a City district)
  • Region (the province name for addresses in Canada, the region name for addresses in Italy, the autonomia name for addresses in Spain, the constituent county name for addresses in the United Kingdom, the state name for addresses in the United States)
  • Postal Code
  • Country

Not all this address data is necessary for MapPoint to pin-point locations. Typically the minimum address data required is City, Postal Code and Country.

In summary, the functional process is as follows (using MapPoint as an example):

  1. When a Location is created in C-TMS, the location is checked to see that if has lat/long. If not, the location is checked in more detail to see if it contains enough address data to calculate the lat/long. Typically the minimum address data required is as mentioned above, City, Postal Code and Country. If enough address data exists on the location a request is queued to the MapPoint interface program (CBDS Interface) to calculate the lat/long.
  2. The queued request is picked up by the CBDS Interface (note that a lat/long calculation request is processed differently to a time and distance request) which then initiates a background MapPoint “session”. The locations for which lat/long is to be calculated is pin-pointed on a MapPoint map using the address data. (MapPoint provides numerous ways of pin-pointing locations, two of which are by lat/long as used in time and distance calculations, and by address as used here).
  3. Once the location is pin-pointed on the map, an algorithm is used to calculate the latitude and longitude of the location.
  4. Once the algorithm is complete the lat/long are returned from MapPoint to the CBDS Interface program. The CBDS Interface program then updates the C-TMS location with the calculated data and marks the request as processed.
  5. The end-to-end process typically takes less than a second or so.