IRouteGetRouteHighlight Method (String) |
Namespace: Telogis.GeoBase.Routing
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 heading | Description |
---|---|
StartTime | The 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. |
Lat | The latitude of the route stop's location, in decimal degrees. |
Lon | The longitude of the route stop's location, in decimal degrees. |
Heading | The heading of the vehicle, in decimal degrees, at the time it arrived at this route stop. |
TimeSincePreviousStop | The time, in seconds, since the previous route stop in the list. |
Speed | The 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
This example uses 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 you click btnHilite, the application loads the points on the route 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:
// 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 // This example uses a hard-coded filename 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; }