Filtering Traffic Incident Data
The HERE Traffic API supports requests for traffic incident data from a specific geographic area (defined by a geospatial filter). The response includes data in XML or JSON format.
Geospatial InclusionA response includes traffic incident items based on their point of origin. So an incident in the response may potentially contain a geolocation outside the area indicated by the geospatial filter in the request. The code example below shows the
GEOLOC/ORIGINparameter used to determine if an item falls within the requested response boundaries.
... <GEOLOC> <ORIGIN> <LATITUDE>37.7894</LATITUDE> <LONGITUDE>-122.38732</LONGITUDE> </ORIGIN> <TO> <LATITUDE>37.8094693</LATITUDE> <LONGITUDE>-122.3657107</LONGITUDE> </TO> </GEOLOC> ...
Incident Types and Filtering
Incident filters allow you to tailor incident requests to specific requirements. The filters support selection based on status, criticality, profiles, or start and end times.
In addition, traffic incidents are classified according to incident type:
- Disabled vehicle
- Mass transit
- Other news
- Planned event
- Road hazard
By default, incident reports included in the response are localized based on their geographic origin. This means the time values are shown in local time and format, and message strings are in the default language for the country identified by the geospatial filter.
Supported Translation Languages
For the list of supported languages for incidents, see Supported Translation Languages.