Click or drag to resize

RouteGetRouteHighlight Method

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Get the likely route that was taken between the points in a given route history, without generating natural language directions or checking for route legality.

Namespace:  Telogis.GeoBase.Routing
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public Directions GetRouteHighlight()

Return Value

Type: Directions
Directions without natural language directions.

Implements

IRouteGetRouteHighlight
Remarks

Route highlighting is used to display the most likely route taken based on a series of RouteStops. This is useful when only the route stops are known, and the actual route taken is not known. In the example below, figure 1 shows three route stops (the arrows depict the vehicle's heading) without a known route. When the "Highlight" button is pressed, GetRouteHighlight() is called, the most likely directions are calculated, and the Route Highlight is displayed on the map, as shown in figure 2.

The route is calculated based on the RouteStops' properties:

  • Lat
  • Lon
  • Heading
  • TimeSincePreviousStop
  • Speed

If not all of these RouteStop properties are known, the bare minimum that can be used is: Lat, Lon, TimeSincePreviousStop. TimeSincePreviousStop values are automatically limited to a maximum of 300 seconds.

Examples

This example is designed with just a MapCtrl, and a button. When the program is loaded, the RouteStops are displayed with their headings. When the button is pressed, the route highlight is rendered on the map. The map's properties are as follows:

  • CenterLat: 37.29524
  • CenterLon: -120.4906
  • Zoom: 3

 // Create a route
 Route myRoute = new Route();

 // Create rendererlist
 RendererList renderList = new RendererList();

private void btnHiLite_Click(object sender, EventArgs e)
{
    displayDirections();
}

private void displayDirections()
{
 // Create directions
 Directions dir;

 // Add route highlight
 dir = myRoute.GetRouteHighlight();

 // Add route and highlight directions
 renderList.Add(dir);

 // Force redraw
 mapCtrl.Invalidate();

}

private void mapCtrl_Load(object sender, EventArgs e)
{
 // Create stops
 RouteStop s1 = new RouteStop(37.2981, -120.4979);
 RouteStop s2 = new RouteStop(37.2952, -120.4906);
 RouteStop s3 = new RouteStop(37.2839, -120.4948);

 // Add intervals between stops
 s1.TimeSincePreviousStop = 0;
 s2.TimeSincePreviousStop = 120;
 s3.TimeSincePreviousStop = 180;

 //Add headings
 s1.Heading = 90;
 s2.Heading = 180;
 s3.Heading = 180;

 // Add stops to route
 myRoute.AddStops(new RouteStop[] { s1, s2, s3 });

 //Add to renderer
 mapCtrl.Renderer = renderList;
 renderList.Add(myRoute);
}

Figure 1

Figure 2

See Also