Traffic API Developer's Guide

Requesting Traffic Flow Data with Max Functional Class Filter

This article illustrates use cases in which requests for traffic flow data use a filter to limit the amount of detail (and therefore the size of the response). The volume of traffic flow data can be very large, especially at high map zoom levels.

Max Functional Class, [Z]/[X]/[Y] Addressing

User Story

The user wants to obtain traffic flow data for an area around Frankfurt am Main, Germany . The area is to be identified using the [Z]/[X]/[Y] addressing scheme, with map zoom level 9. The response must deliver data in XML, filtering the results to include functional road class types no higher than 2.

Request Summary

The following list summarizes the elements required to create a request matching the user story and shows, in square brackets, how those elements are used in the request example below. Note that the request example also uses the authentication parameters.

Resource: flow [flow]
URL variables: {data_format} [xml], response data format specification, here XML (to indicate that JSON is required, use json)
  {zoom}/{column}/{row} [9/268/173] , the [Z]/[X]/[Y] (tile) addressing scheme, see also The Mercator Projection
Parameters: maxfunctionalclass [maxfunctionalclass=2], maximum functional class for items included in the response (items with a higher functional class are filtered out) – see also FunctionalClassType

Request

A request matching the user story is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/flow/xml/9/268/173
?app_code={YOUR_APP_CODE}
&app_id={YOUR_APP_ID}
&maxfunctionalclass=2

Response

The following code block shows the response the request for traffic flow data with a maximum functional class filter. Note that this response is abbreviated because of space limitations. In reality, the XML may contain a very large number of <RW> elements.

<?xml version="1.0" encoding="UTF-8"?>
<TRAFFICML_REALTIME MAP_VERSION="" CREATED_TIMESTAMP="2013-10-14T16:19:08Z" VERSION="3.1" UNITS="metric">
  <RWS TY="TMC" EBU_COUNTRY_CODE="D" EXTENDED_COUNTRY_CODE="E0" TABLE_ID="1">
    <RW LI="D01+07176" DE="A648" PBT="2013-10-14T16:19:08+0000" mid="141b7c32502|5f144646-29dd-40ee-a626-94e1b9184b4b">
      <FIS>
        <FI>
          <TMC PC="12103" DE="Eschborner Dreieck" QD="-" LE="0.75953"/>
          <CF CN="0.89" FF="59.7" JF="0.0" SP="64.0" TY="TR"/>
        </FI>
        <FI>
          <TMC PC="12104" DE="Frankfurt am Main-Rödelheim" QD="-" LE="0.46107"/>
          <CF CN="0.89" FF="66.5" JF="0.59" SP="63.35" TY="TR"/>
        </FI>
        <FI>
          <TMC PC="12105" DE="Westkreuz Frankfurt am Main" QD="-" LE="1.20252"/>
          <CF CN="0.89" FF="63.4" JF="0.64" SP="60.16" TY="TR"/>
        </FI>
      </FIS>
    </RW>
    <RW LI="D01+07184" DE="A661" PBT="2013-10-14T16:19:08+0000" mid="141b7c32e76|96d6710e-a38c-49d0-a0dd-ffc164ae9cf6"></RW>
    ...
  </RWS>
</TRAFFICML_REALTIME>

Max Functional Class, Quadkey Addressing

A quadkey version of the previous request is shown below. Further alternatives are to use a proximity (prox) or a bounding box filter (bbox) to replace the quadkey string parameter / value.

User Story

The user wants to obtain traffic flow data for an area around Frankfurt am Main, Germany . The area is to be identified using a quadkey. The response must deliver data in XML, filtering the results to include functional road class types no higher than 2.

Request Summary

The following list summarizes the elements required to create a request matching the user story and shows, in square brackets, how those elements are used in the request example below. Note that the request example also uses the authentication parameters.

Resource: flow [flow.xml], the resource and resource extension indicating the required response data format, here XML (to indicate JSON, use flow.json)
Parameters: quadkey [quadkey=12020330] , map tile location specified as a single value, see also Quadkeys
  maxfunctionalclass [maxfunctionalclass=2], maximum functional class for items included in the response (items with a higher functional class are filtered out) – see also FunctionalClassType

Request

A request matching the user story is formulated as follows:

https://traffic.cit.api.here.com/traffic/6.2/flow.xml
?quadkey=12020330
&app_code={YOUR_APP_CODE}
&app_id={YOUR_APP_ID}
&maxfunctionalclass=2

Response

The result of this request is similar to that shown under Response.

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.