Traffic API Developer's Guide

Road Shape and Road Class Filters

The user wants to obtain the shape and functional class information of a roadway corresponding to the specified flow item.

Request

The request specifies a bounding box area and uses the responseattributes parameter for the shape and functional class information:

https://traffic.ls.hereapi.com/traffic/6.2/flow.xml
?apiKey={YOUR_API_KEY}
&bbox=39.8485715,-86.0969867;39.8358934,-86.0757964
&responseattributes=sh,fc
Note: This example uses a HERE API Key to authenticate your request. For information on other possible options, see Authentication Guide. For examples of how to use the other authentication options with the Traffic API, see Authentication Examples.

Response

The response to the request contains:
  • FC attribute for the functional class information
  • <SHP> element for the shape
Note: Response could be different depending on the endpoint used: for 6.1 endpoint <SHP> elements for Ramps are not returned, for 6.2 endpoint all <SHP> are always returned.
<?xml version="1.0" encoding="UTF-8"?>
<TRAFFICML_REALTIME CREATED_TIMESTAMP="2017-06-02T18:10:48Z" MAP_VERSION="" UNITS="imperial" VERSION="3.2" xmlns="http://traffic.nokia.com/trafficml-flow-3.2">
  <RWS EBU_COUNTRY_CODE="1" EXTENDED_COUNTRY_CODE="A0" MAP_VERSION="201702" TABLE_ID="7" TY="TMC" UNITS="imperial">
    <RW DE="Binford Blvd" LI="107+01100" PBT="2017-06-02T18:10:13Z" mid="1fe417f0-f17e-47b8-b0b0-b67a71eec11d|">
      <FIS>
        <FI>
          <TMC DE="E Kessler Boulevard East Dr" LE="1.5983" PC="8367" QD="-"/>
          <SHP FC="3">39.8405,-86.11263 39.84072,-86.11237</SHP>
          <SHP FC="3">39.84072,-86.11237 39.8413,-86.11168</SHP>
          <SHP FC="3">39.8413,-86.11168 39.84181,-86.11106 39.84235,-86.11039 39.84307,-86.10953 39.84487,-86.10738 39.84663,-86.10527 39.84747,-86.10427 39.84793,-86.10369</SHP>
          <SHP FC="3">39.84793,-86.10369 39.84886,-86.10255 39.84949,-86.10172 39.85041,-86.10046 39.85088,-86.09985 39.85137,-86.09926 39.85169,-86.09888 39.85203,-86.09854 39.85237,-86.09821 39.85272,-86.09789 39.85307,-86.09758 39.85343,-86.09729 39.8542,-86.09673 39.85502,-86.09616</SHP>
          <SHP FC="3">39.85502,-86.09616 39.85534,-86.09595 39.85631,-86.09528 39.85691,-86.09487 39.85751,-86.09443</SHP>
          <SHP FC="3">39.85751,-86.09443 39.85808,-86.09399 39.85836,-86.09379</SHP>
          <CF CN="0.97" FF="47.85" JF="1.39455" SP="39.84" SU="39.84" TY="TR"/>
        </FI>
        <!-- ... -->
      </FIS>
    </RW>
  </RWS>
</TRAFFICML_REALTIME>