Click or drag to resize

Telogis.GeoBase.Routing

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

Contains classes related to vehicle routing and getting driving directions.

Classes
NameDescription
Routing.ArrivalMovementEventA wrapper class to be filled server-side that represents an arrival movement.
Routing.ArriveEventA wrapper class to be filled server-side that represents an arrival event.
Routing.DepartEventA wrapper class to be filled server-side that represents a departure event.
Routing.DepartureMovementEventA wrapper class to be filled server-side that represents a departure movement.
Routing.DirectionA wrapper class to be filled server-side, representing a single instruction in a Routing.Route.
Routing.DirectionsA representation of a driving route through a number of stops. This is a wrapper class to be filled server-side.
Routing.DrivingEventA base class, populated server-side, that represents an event that occurs en route -- such as a driving direction or movement.
Routing.DrivingNoteA wrapper class to be filled server-side that represents a note attached to a direction.
Routing.FerryMovementEventA wrapper class to be filled server-side that represents a ferry movement.
Routing.FFRampMovementEventA wrapper class to be filled server-side that represents an FF ramp movement.
Routing.FreewayEndsNoteEventA wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.
Routing.FSRampMovementEventA wrapper class to be filled server-side that represents an FS ramp movement.
Routing.LoadElementTypeDescribes a type of load
Routing.MovementA wrapper class to be filled server-side that represents a driving direction instructing the driver to turn at an intersection.
Routing.MovementEventA wrapper class to be filled server-side that represents a Routing.DrivingEvent that happens during a movement.
Routing.NameChangeNoteEventA wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.
Routing.NoteA wrapper class to be filled server-side that represents a note attached to a direction.
Routing.RampMovementA base class representing a movement event along a freeway ramp.
Routing.RoundAboutMovementEventA wrapper class to be filled server-side that represents a roundabout movement.
Routing.RouteA class for constructing point-to-point directions and optimizing multi-stop routes.
JavaScript
var LatLon = Telogis.GeoBase.LatLon;
var RouteStop = Telogis.GeoBase.Routing.RouteStop;

// Create three route stops
var RouteStop1 = new RouteStop(new LatLon(33.587512,-117.741400));
var RouteStop2 = new RouteStop(new LatLon(33.553872,-117.728464));
var RouteStop3 = new RouteStop(new LatLon(33.537614,-117.687859));

// Create an array of route stops
var StopsArray = [RouteStop1, RouteStop2, RouteStop3];

// Specify a routing strategy --  RoutingStrategyFastest is the default
var RoutingStrategyFastest = new Telogis.GeoBase.Routing.RoutingStrategyFastest();

// Create a new route
var myRoute = new Telogis.GeoBase.Routing.Route({
        stops: StopsArray,
        strategy: RoutingStrategyFastest
});

// Was the route created? Check that there are three stops...

// document.onclick = myTestFunction;
function myTestFunction() {
        alert ('There are ' + myRoute.getStopCount() + ' stops in this route.');
};
Routing.RouteStopA wrapper class for containing a route stop in a format understood by the server. In all other situations, LatLons should be used instead, and since the conversion between the two is handled by the Routing.Route class, this class need not be used directly.
JavaScript
var myRouteStop = new Telogis.GeoBase.Routing.RouteStop(new Telogis.GeoBase.LatLon(33.612914,-117.745395));
Routing.RoutingProfileA 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);
Routing.RoutingStrategyDescribes a set of constraints to which the routing engine should adhere when calculating a route.
JavaScript
// Create a strategy that allows u-turns, road crossings and travel along toll roads.
var myStrategy = new Telogis.GeoBase.Routing.RoutingStrategy({
    allowUTurns: true,
    extraProcessingRatio: 1,
    roadCrossingBehavior: 'Telogis.GeoBase.Routing.RoadCrossingBehavior.ALLOWED',
    // ALLOWED is the default. Alternative options are 'DISCOURAGED' and 'FORBIDDEN'
    useTollRoads: true
});

// Create a route
var myRoute = new Telogis.GeoBase.Routing.Route();

// Apply the strategy to the route
myRoute.setStrategy(myStrategy);
Routing.RoutingStrategyFastestA type of Routing.RoutingStrategy that specifies a custom callback on the server to favor faster routes.
JavaScript
var fastest_strategy = new Telogis.GeoBase.Routing.RoutingStrategyFastest();
route.setStrategy(fastest_strategy);
Routing.RoutingStrategyShortestA type of Routing.RoutingStrategy that specifies a custom callback on the server to favor shorter routes.
JavaScript
var shortest_strategy = new Telogis.GeoBase.Routing.RoutingStrategyShortest();
route.setStrategy(shortest_strategy);
Routing.SFRampMovementEventA wrapper class to be filled server-side that represents an SF ramp movement.
Routing.SplitMovementEventA wrapper class to be filled server-side that represents a split movement.
Routing.StateChangesNoteEventA wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.
Routing.TollwayBeginsNoteEventA wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.
Routing.TollwayEndsNoteEventA wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.
Routing.TurnMovementA wrapper class to be filled server-side that represents a turn movement.
Routing.VehicleSpecUsed to describe a vehicle's specifications.
JavaScript
// Create a new vehicle specifications object
var VehSpec = new Telogis.GeoBase.Routing.VehicleSpec();

// Set some vehicle properties (weight, height, length, width etc.)
VehSpec.GrossWeight_kg = 30000; // 30 tonnes
VehSpec.Height_cm = 410; // 4.1 meters high
VehSpec.Length_cm = 1800; // 18 meters long
VehSpec.Width_cm = 260; // 2.6 meters wide

// Apply the VehicleSpec to a route --
// Routes will now be generated that are safe for a vehicle with
// the described specifications. For example, avoiding bridges
// that are too low or too narrow, or that cannot support the
// vehicle's weight
myRoute.setVehicleSpec(VehSpec);
Routing.VehicleTypeDescribes a type of vehicle. When applied to a route as a vehicle specification, routes suitable for the specified vehicle type will be generated. For example, Emergency vehicles will be routed using emergency vehicle lanes and directions; and Taxi, CarPool and Bus vehicle types will be routed along suitable restricted traffic lanes where available.
JavaScript
// Create a new vehicle specifications object
var VehSpec = new Telogis.GeoBase.Routing.VehicleSpec();

// Set the vehicle type (tractor semi trailer)
VehSpec.VehicleType = Telogis.GeoBase.Routing.VehicleType.TractorSemiTrailer;

// Apply the VehicleSpec to a route --
// Routes will now be generated that are legal for the vehicle type
myRoute.setVehicleSpec(VehSpec);
Routing.WaypointA wrapper class for containing a waypoint in a format understood by the server. In all other situations, LatLons should be used instead, and since the conversion between the two is handled by the Routing.Route class, this class need not be used directly.
Routing.WayPointEventA wrapper class to be filled server-side that represents a waypoint event.
Functions
NameDescription
getLocation ()

Gets the latitude-longitude coordinates of the location associated with this Routing.FerryMovementEvent.

Returns

LatLon - The location of the note.

Properties
NameTypeDescription
RoadCrossingBehaviorObject

A set of codes that instruct the routing engine to treat road crossings in a certain way.

Properties
NameTypeDescription
ALLOWEDString

allows road crossings.

DISCOURAGEDString

discourages road crossings.

FORBIDDENString

forbids road crossings.