Click or drag to resize

RouteGetRouteHighlight Method (String)

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Reads point data from a file, and gets the likely route that was taken between the points in the route, 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(
	string dataUrl
)

Parameters

dataUrl
Type: SystemString
URL of the CSV file that contains the route stop data.

Return Value

Type: Directions
Directions without natural language directions.

Implements

IRouteGetRouteHighlight(String)
Remarks

This method is only valid when the map data source is a GeoStream server.

The route stop data should be in a CSV file. The file can contain the following column headings:

Column headingDescription
StartTimeThe time of arrival at the first route stop in the list, in ticks since 00:00:00, 1 January 0001. There are 10,000,000 ticks per second. See DateTime.
LatThe latitude of the route stop's location, in decimal degrees.
LonThe longitude of the route stop's location, in decimal degrees.
HeadingThe heading of the vehicle, in decimal degrees, at the time it arrived at this route stop.
TimeSincePreviousStopThe time, in seconds, since the previous route stop in the list.
SpeedThe vehicle's speed at the time it arrived at this route stop.

The first row of the CSV file must contain only the StartTime column heading. The second row must contain a single StartTime value.

The remaining column headings must be on the third row, followed by a row for each route stop. They do not have to be in any particular order, but the method requires at least Lat, Lon, and TimeSincePreviousStop.

GeoBase will ignore any column headings that it does not recognize.

Example of a valid CSV file

Examples

This example is designed with just a Map control(mapCtrl), and a button (btnHilite). When the program is loaded, the map is displayed, using data from the local GeoStream server. When the button is pressed, the route is read from a data file on the local GeoStream server, and then the route highlight is rendered on the map. The map's properties are as follows:

  • CenterLat: 33.98
  • CenterLon: -118.35
  • Zoom: 6
// 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("http://localhost/GeoStream/highlight.csv");
   // Add route and highlight directions
   renderList.Add(dir);
   // Force redraw
   mapCtrl.Invalidate();
}

private void mapCtrl_Load(object sender, EventArgs e) {
   // Specify one or more GeoStream servers... 
   string[] servers = { @"http://localhost/GeoStream/" };
   // ...and use those GeoStream servers in the creation of our repository...
   Repository.CurrentThreadRepository = new GeoStreamRepository(servers);
   // Add to renderer
   mapCtrl.Renderer = renderList;
}
See Also