HERE iOS SDK Developer's Guide

NMATrafficEvent

Class Summary

class NMATrafficEvent

Derived from: NSObject

NMATrafficEvent represents a real-world traffic event such as an accident or road work.

Include: NMAKit.framework/headers/NMATrafficEvent.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMATrafficEvent

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, assign] NSDate *  activationDate

The time at which the traffic event became active

[readable, assign] NMAGeoBoundingBox affectedArea

The geographical area affected by the traffic event

[readable, assign] NSArray *  affectedRoadElements

The road elements affected by the traffic event

[readable, assign] NSString *  affectedStreets

A comma-separated list of streets affected by the traffic event

[readable, assign] NSString *  description

A localized description of the traffic event

[readable, assign] NSString *  endingStreets

A comma-separated list of streets forming the intersection where the traffic event ends

[readable, assign] NSString *  firstAffectedStreet

The street at the beginning of the traffic event

[readable, assign] NMAImage icon

Deprecated: This method is deprecated as of HERE SDK 3.2. Please use the iconOffRoute property instead.

An icon represeting the traffic event off a route

[readable, assign] NMAImage iconOffRoute

An icon representing the traffic event off a route

[readable, assign] NMAImage iconOnRoute

An icon represeting the traffic event on a route

[readable, assign] BOOL  isFlow

Indicates whether the traffic event is a flow event

[readable, assign] BOOL  isIncident

Indicates whether the traffic event is an incident event

[readable, assign] BOOL  isReroutable

Indicates whether the traffic event is reroutable

[readable, assign] BOOL  isVisible

Indicates whether the traffic event is visible at the current time

[readable, assign] NSInteger  length

The affected length of the traffic event, in meters

[readable, assign] NSInteger  penalty

The penalty value associated with the traffic event

[readable, assign] NMATrafficEventSeverity   severity

Indicates the severity of the traffic event, from "Normal" to "Blocking"

[readable, assign] NSString *  shortText

Gets the short text (category) of this event

[readable, assign] NSInteger  speedLimit

The speed limit in km/h of roads affected by the traffic event

[readable, assign] NSString *  startingStreets

A comma-separated list of streets forming the intersection where the traffic event starts

[readable, assign] NSInteger  trafficSpeed

The estimated speed in km/h of traffic moving through the event

[readable, assign] NSDate *  updateDate

The time at which the traffic event was last updated

[readable, assign] BOOL  valid

Indicates whether the traffic event is valid at the current time

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(NSUInteger) distanceToGeoCoordinates:( NMAGeoCoordinates *) coordinates

The distance in meters between the traffic event and the specified NMAGeoCoordinates

-(void) getAffectedStreetsWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the affected streets information for this traffic event and executes a block when the request completes

-(void) getEndingStreetsWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the ending streets information for this traffic event and executes a block when the request completes

-(void) getFirstAffectedStreetWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the first affected street information for this traffic event and executes a block when the request completes

-(void) getStartingStreetsWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the starting streets information for this traffic event and executes a block when the request completes

-(BOOL) isOnRoute:( NMARoute *) route

Indicates whether the traffic event is on the given route

Class Details

NMATrafficEvent represents a real-world traffic event such as an accident or road work.

Note:

Not all traffic events will have complete information available, and some information may not be available immediately. If a property returns nil, it should be checked again after some time.

Note:

Traffic data may become stale over time. The valid property should be checked to determine if the traffic event is active and up-to-date.

Public Property Details

[readable, assign] NSDate * activationDate

The time at which the traffic event became active.

Note:

Will be nil if unavailable.

[readable, assign] NMAGeoBoundingBoxaffectedArea

The geographical area affected by the traffic event.

[readable, assign] NSArray * affectedRoadElements

The road elements affected by the traffic event.

Note:

This is a list of NMARoadElement, will be nil if unavailable.

[readable, assign] NSString * affectedStreets

A comma-separated list of streets affected by the traffic event.

This property may be nil if the information is not yet available. Reading this value will automatically request the necessary information, or you may use the getAffectedStreetsWithCompletion: method to request the information and be notified when it is available.

Note:

The order of streets in the list is not significant.

[readable, assign] NSString * description

A localized description of the traffic event.

Note:

The description of an event may not be immediately available. If nil is returned, this property should be checked again after some time.

[readable, assign] NSString * endingStreets

A comma-separated list of streets forming the intersection where the traffic event ends.

This property may be nil if the information is not yet available. Reading this value will automatically request the necessary information, or you may use the getEndingStreetsWithCompletion: method to request the information and be notified when it is available.

[readable, assign] NSString * firstAffectedStreet

The street at the beginning of the traffic event.

This property may be nil if the information is not yet available. Reading this value will automatically request the necessary information, or you may use the getFirstAffectedStreetWithCompletion: method to request the information and be notified when it is available.

[readable, assign] NMAImageicon

Deprecated: This method is deprecated as of HERE SDK 3.2. Please use the iconOffRoute property instead.

An icon represeting the traffic event off a route.

Note:

Will be nil if the icon is not available.

[readable, assign] NMAImageiconOffRoute

An icon representing the traffic event off a route.

[readable, assign] NMAImageiconOnRoute

An icon represeting the traffic event on a route.

Note:

Will be nil if the icon is not available.

[readable, assign] BOOL isFlow

Indicates whether the traffic event is a flow event. Flow events are shown as colored lines on road segments.

[readable, assign] BOOL isIncident

Indicates whether the traffic event is an incident event. Incident events are shown as icons on the map.

[readable, assign] BOOL isReroutable

Indicates whether the traffic event is reroutable.

[readable, assign] BOOL isVisible

Indicates whether the traffic event is visible at the current time.

A traffic event is visible if it applies now or will apply in the future.

[readable, assign] NSInteger length

The affected length of the traffic event, in meters.

Note:

Will contain a negative value if the length is unavailable.

[readable, assign] NSInteger penalty

The penalty value associated with the traffic event.

Penalty values are on the range [0, 100], with 0 being no penalty and 100 being the maximum penalty.

[readable, assign] NMATrafficEventSeverity  severity

Indicates the severity of the traffic event, from "Normal" to "Blocking".

See also:

NMATrafficEventSeverity

[readable, assign] NSString * shortText

Gets the short text (category) of this event.

The default possible return values are "CLOSURE", "ROADWORKS", "ACCIDENT", "CONGESTION", "OTHER", "FLOW". The text is NOT localized.

Note:

The possible return values are configured in the traffic.xml file. For most customers the default values should be used. Do not attempt to modify traffic.xml without contacting your HERE representative.

[readable, assign] NSInteger speedLimit

The speed limit in km/h of roads affected by the traffic event.

Note:

Will contain a negative value if the speed limit is unavailable.

[readable, assign] NSString * startingStreets

A comma-separated list of streets forming the intersection where the traffic event starts.

This property may be nil if the information is not yet available. Reading this value will automatically request the necessary information, or you may use the getStartingStreetsWithCompletion: method to request the information and be notified when it is available.

[readable, assign] NSInteger trafficSpeed

The estimated speed in km/h of traffic moving through the event.

Note:

Will contain a negative value if the traffic speed is unavailable.

[readable, assign] NSDate * updateDate

The time at which the traffic event was last updated.

Note:

Will be nil if unavailable.

[readable, assign] BOOL valid

Indicates whether the traffic event is valid at the current time.

A traffic event is considered valid if it applies now, i.e. it does not occur in the past or future.

Instance Method Details

-(NSUInteger) distanceToGeoCoordinates:( NMAGeoCoordinates *) coordinates

The distance in meters between the traffic event and the specified NMAGeoCoordinates.

Returns:

The distance to the traffic event, or a negative value if the distance could not be determined.

-(void) getAffectedStreetsWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the affected streets information for this traffic event and executes a block when the request completes.

If the requested information is not received after a time limit, the completion block will be executed and the affectedStreets property will still be nil.

-(void) getEndingStreetsWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the ending streets information for this traffic event and executes a block when the request completes.

If the requested information is not received after a time limit, the completion block will be executed and the endingStreets property will still be nil.

-(void) getFirstAffectedStreetWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the first affected street information for this traffic event and executes a block when the request completes.

If the requested information is not received after a time limit, the completion block will be executed and the firstAffectedStreet property will still be nil.

-(void) getStartingStreetsWithCompletion:( NMATrafficEventCompletionBlock ) completion

Asynchronously requests the starting streets information for this traffic event and executes a block when the request completes.

If the requested information is not received after a time limit, the completion block will be executed and the startingStreets property will still be nil.

-(BOOL) isOnRoute:( NMARoute *) route

Indicates whether the traffic event is on the given route.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.