Advanced route options, Routing preferences – Pitney Bowes MapXtreme User Manual

Page 367

Advertising
background image

Chapter 20: Routing

Advanced Route Options

MapXtreme v7.1

374

Developer Guide

routing, a list of sequences will be included in the response. Each sequence includes the start and
end point, as well as the distance, and time. There are numerous additions you can make to a matrix
route request to return additional information in the response. These additions are:

Routing Preferences

Avoiding Points, Features, and Segments

Updating a Request Using Routing Data

A matrix route is created using the MatrixRouteRequest class. The matrix route request must consist
of a MatrixRouteCost and may include a MatrixRoutingPreferences. Refer to the Developer
Reference for API-level syntax and descriptions.

Advanced Route Options

There are numerous advanced capabilities that can be added to your routing applications. This
section highlights these important capabilities used to customize your point-to-point, multi-point, and
matrix route requests.

Routing Preferences

You can specify various preferences for each type of route you are calculating. All of these
preferences are optional, but can be very important in determining the accuracy of the route and
helping you create a more meaningful route. You can return the route with fastest time from the start
point to the end point or the shortest distance from the start point to the end point. If specified, these
preferences will override the route optimization settings defined in the server or service
configuration. The preferences may be overridden by server preferences if the server preferences
are more restrictive.

The type of route calculation (point-to-point, multi-point, or matrix) determines which route
preferences are available to use. The following list outlines the available route preferences:

DistanceUnit - You can specify the distance unit for all of the route calculations. The most
common units are Kilometer, Meter, Mile, Yard, and Foot. If a value is not specified, the default
setting will be used (Mile).

RouteMethod - Determines the general type of route preference to perform. The route client can
either perform Fastest or Shortest route calculations. If a value is not specified, the default
setting will be used (Fastest).

OptimizeIntermediatPoints (only used in multi-point routes) - Determines if the via points are to
be traversed in the order specified in the request or have the route client find the optimal route
using these via points. By default (false) the route client will traverse the specified points in the
order in the request. When set to true, the optimal route using the via points is calculated.

StopThreshold (only used in multi-point routes) - Sets the route calculation algorithm stop
threshold. The route algorithm will stop calculating and return the current ‘best’ route when the
difference in time or distance between the route candidates remaining in the algorithm reaches
the stop threshold. Valid values are any positive numbers. For best performance, a positive
number less than one is recommended. Setting the stop threshold is a balancing factor between
accuracy and speed. The lower the threshold value on average, the more accurate the result and
the longer the route will take to calculate. The stop threshold has a minimal effect on routes with
few via points (under 10). The default is 0.01 (1 percent).

Advertising