Vehicle Constraints

Vehicle constraints provide more detail about roads such as bridge heights and weight restrictions. This is of special interest to trucking fleets to ensure trucks are following safe and legal routes. These constraints are normally provided in a separate truck attribute GBFS file. Sample truck data can be found in the Sample Data section.

Vehicle Attributes

Vehicle attributes set the dimensions of your vehicle, such as height, weight and length. These are used by the routing engine to find a correct route based on where your vehicle is allowed to travel.

Constraints and Routing

The easiest way to see this in action is by using the MapExplorer sample application provided with GeoBase. Copy the HERE truck attribute data to your data directory:

C:\Program Files\Telogis\GeoBase\GeoBaseResources\data\gb.x.x

Start MapExplorer:

Start > All  Programs > Telogis GeoBase Developer’s Kit > Map Explorer

One example location with truck attributes set is in Santa Ana, California. Search for the following LatLon in MapExplorer:


Zoom in and right-click near the push-pin. Select Query Street Link to see the following Street Details:

E Dyer Rd Street Link

This shows the constraints set for this segment of the road have a height restriction of 467cm for all vehicle types. This is due to the Costa Mesa Freeway overpass. When a vehicle attribute meets or exceeds this height the speed limit is set to 0 so that it will not be used by the routing engine. Note that not all road segments will have constraints set.

To test this constraint, create a route from:

574 E Dyer Rd, Santa Ana, Orange, California, 92707, USA


1850 E Dyer Rd, Santa Ana, Orange, California, 92705, USA

A vehicle without any attributes can travel straight on Dyer Rd:

Unconstrained routing

To enable truck attributes in MapExplorer, select Route (from the top menu) and then Truck Attributes and you are presented with the Truck Route Settings dialog. In the Height field, set the value to 466cm.

Setting the height in the Truck Route Settings dialog

NOTE: This dialog must be left open for the attributes to be used during routing.

With the dialog still open, run Route > Get Directions again. The route has not changed because the vehicle height is still below the restriction. Now set the height to 467cm and Route > Get Directions to see that the vehicle must now avoid that road segment:

Constrained route

This can also be seen in the MobileNav sample application:

MobileNav Truck AttributesMobileNav constrained routing

Coding Attributes and Constraints

Vehicle constraints are automatically used by the GeoBase routing engine based on the vehicle attributes you set.

Use a VehicleSpec object to set attributes on the Route object and then calculate the route. This example shows how to set vehicle attributes when routing between two RouteStops:

Route my_route = new Route(routeStop1,routeStop2);

// configure the vehicle dimensions
VehicleSpec vs = my_route.VehicleSpec;
vs.VehicleType = VehicleType.Truck;
vs.GrossWeight_kg = 37000;
vs.NumberOfTrailers = 1;
vs.KingpinToLastAxle_cm = 880;
vs.Height_cm = 470; // about 15" high
vs.Length_cm = 6500; // about 21" long

// configure the vehicle load
vs.SetLoadInfo(0, LoadType.Hazmat_3, 800); // 800 kg of paint

// Unless the VehicleSpec on the Route is reassigned as follows, 
// the changes to vs will have no effect on my_route - VehicleSpec 
// is a struct, so vs is a copy of the VehicleSpec being used by my_route.
my_route.VehicleSpec = vs;

// now, when we ask for directions the route will consider
// the vehicle attributes defined in our VehicleSpec
Directions my_dirs = my_route.GetDirections();

Viewing Constraints on a Street Link

Use the GetConstraints function to get a list of ConstraintLinks. For example:

GeoCodeFull gcf = GeoCoder.ReverseGeoCodeFull(latlon);

List<ConstraintLinks> constraints = new System.Collections.Generic.List<ConstraintLinks>();

constraints = (my_route.GetConstraints(((StreetLink)gcf.StreetLink).FirstPoint, ConstraintLinkDirection.FromReference, false));

What vehicle attributes and constraints are available?

See the following sections in the GeoBase documentation for a complete list:

VehicleAttribute enumeration - describes properties that a vehicle has.

VehicleType enumeration - describes a type of vehicle.

ConditionBlockType enumeration - a list of the vehicle constraints

Learn More

The GeoBase help provides full API documentation: C:\Program Files\Telogis\GeoBase\help\Telogis GeoBase.chm.

The GeoBase SDK provides sample applications (MapExplorer and MobileNav) that use vehicle constraints and include source code in: C:\Documents and Settings\All Users\Application Data\GeoBase Examples or C:\Program Files (x86)\Telogis\GeoBase\Telogis GeoBase Examples.



Published, Jul 7th 2016, 22:33

Tagged under: dotnet mobile geobase vehicle attributes and constraints routing map data navigation