Click or drag to resize

IBatchTrafficSource Interface

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
An IBatchTrafficSource provides bulk querying of traffic data.

Namespace:  Telogis.GeoBase.Traffic
Assembly:  geobase.net (in geobase.net.dll) Version: 4.99.0.0
Syntax
public interface IBatchTrafficSource : IGenericTrafficSource

The IBatchTrafficSource type exposes the following members.

Methods
  NameDescription
Public methodGetTraffic
Get traffic information for one or more links.
Top
Remarks

The IBatchTrafficSource interface is implemented to provide bulk querying of traffic data. IBatchTrafficSource provides a function GetTraffic which may be called to fetch traffic information for one or more links (specified as an ITrafficRequest). The ITrafficRequest interface provides access to one or more ITrafficItem objects, each containing information for a single link. ITrafficItem.SetSpeed should be used to set the speed of each ITrafficItem as appropriate.

Examples
C#
class MyTrafficSource : IBatchTrafficSource {

    public Dictionary<string, double> TMCToSpeed = new Dictionary<string, double>();

    public void GetTraffic(ITrafficRequest request) {
        foreach (ITrafficItem item in request) {
            double speedMph;
            if (TMCToSpeed.TryGetValue(item.TMC, out speedMph)) {
                item.SetSpeed(speedMph, SpeedUnit.MilesPerHour);
            }
        }
    }
}
See Also