Pitney Bowes MapXtreme User Manual

Page 380

Advertising
background image

Chapter 20: Routing

Updating a Request Using Routing Data

MapXtreme v7.1

387

Developer Guide

particular road type which will set those roads to a lower priority, and decrease the chance of them
being used in the calculation. Use the following classes to perform the various road type transient
updates:

RoadTypeSpeedUpdate - Updates the speed of a particular road type with a new speed.

The following sample shows how to define a new speed of 50 miles per hour (Velocity(50,
VelocityUnit.Mph)) for all urban major roads (RoadType.MAJOR_ROAD_URBAN):

Public Shared Sub New_RoadTypeSpeedUpdate()
’ Create the velocity object
Dim velocity As Velocity = New Velocity(50, VelocityUnit.Mph)
’ Create the update object
Dim update As RoadTypeSpeedUpdate = New
RoadTypeSpeedUpdate(RoadType.MAJOR_ROAD_URBAN, velocity)
End Sub

RoadTypeRelativeSpeedUpdate - Updates the speed of the road type with a change in speed.

The following sample shows how to increase the speed by 5 miles per hour (Velocity(5,
VelocityUnit.Mph)) for all urban major roads (RoadType.MAJOR_ROAD_URBAN):

Public Shared Sub New_RoadTypeRelativeSpeedUpdate()
’ Create the velocity object
Dim velocity As Velocity = New Velocity(5, VelocityUnit.Mph)
’ Increase the speed by 5 mph.
Dim update As RoadTypeRelativeSpeedUpdate = New
RoadTypeRelativeSpeedUpdate(RoadType.MAJOR_ROAD_URBAN, velocity)
End Sub

RoadTypePercentageSpeedUpdate - Updates the speed of the road type with percentage of
the default speed.

The following sample shows how to increase the speed for all urban major roads by 20 percent
(RoadType.MAJOR_ROAD_URBAN, 20):

Public Shared Sub New_RoadTypePercentageSpeedUpdate()
’ Increase the speed by 20 percent.
Dim update As RoadTypePercentageSpeedUpdate = New
RoadTypePercentageSpeedUpdate(RoadType.MAJOR_ROAD_URBAN, 20)
End Sub

Advertising