Click or drag to resize

Telogis.GeoBase.Routing.RoutingProfile

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
RoutingProfile Class

A class used to determine the speed profile (the permitted speed of travel), based on either speed category or a custom speed profile generated using an array of 48 speed values (one for each functional class and speed combination). This array is constructed using six consecutive blocks of eight elements. Each block represents a functional class (1-6), the first block represents functional class 1, the second block functional class 2, etc. The first element in the each block corresponds to speed category 1, the second element speed category 2, etc. These profiles are used when routing, and applied as a Routing.RoutingStrategy.

JavaScript
var speed = Telogis.GeoBase.SpeedUnit.MilesPerHour;
var strategy = new Telogis.GeoBase.Routing.RoutingStrategyFastest();
var profile = new Telogis.GeoBase.Routing.RoutingProfile();
// For every speed category (1-8)
for (speedCat = 1; speedCat <9; ++speedCat) {
    // And every functional class (1-6)
    for (var funcClass = 1; funcClass < 7; ++funcClass) {
    // Set the profile speed to 10mph
    profile.setSpeed(speedCat, funcClass, 10, speed);
    }
}
// Apply the routing profile to the strategy in the UK
strategy.setProfile("UK", profile);
Functions
NameDescription
getIndex (Number speedCat, Number funcClass)

Gets the index of the Routing.RoutingProfile.

Arguments
  • speedCat (Number) - The speed category to use. Available values are 1-8, inclusive. A lower value indicates a higher speed.

  • funcClass (Number) - The functional class of the link. Available values are 1-6, inclusive.

Returns

Number - The index of the Routing.RoutingProfile.

getSpeed (Number speedCat, Number funcClass, String unit)

Gets the travel speed, permitted for a given speed category and functional class.

JavaScript
var speed = Telogis.GeoBase.SpeedUnit.MilesPerHour;
var myProfile = new Telogis.GeoBase.Routing.RoutingProfile();
// Set speed category 1 and functional class 1 speed limit to 50 mph
myProfile.setSpeed(1, 1, 50, speed);
// Get the speed profile. 
var speedVal = myProfile.getSpeed(1, 1, speed);
alert ("Profile speed for speedCat 1 and FuncClass 1 is: " + speedVal + " mph");
Arguments
  • speedCat (Number) - The speed category (1-8).

  • funcClass (Number) - The functional class (1-6).

  • unit (String) - The unit speed is measured in, which should be a SpeedUnit code.

Returns

Number - The speed in the SpeedUnit specified.

setSpeed (Number speedCat, Number funcClass, Number speed, String unit)

Sets the travel speed permitted for a given speed category and functional class.

JavaScript
var speed = Telogis.GeoBase.SpeedUnit.MilesPerHour;
var strategy = new Telogis.GeoBase.Routing.RoutingStrategyFastest();
var myProfile = new Telogis.GeoBase.Routing.RoutingProfile();
// Set speed category 1 and functional class speed limit to 40 mph
myProfile.setSpeed(1, 1, 40, speed);
// Apply the routing profile to the routing strategy in the UK
strategy.setProfile("UK", myProfile);
Arguments
  • speedCat (Number) - The speed category (1-8).

  • funcClass (Number) - The functional class (1-6).

  • speed (Number) - The speed of travel.

  • unit (String) - The unit speed is measured in, which should be a SpeedUnit code.