How do I couple segmented CF traffic data (SS) with shape data (SHP)?

59 Views Asked by At

The "Road Shape and Road Class Filters" resource's example seems to imply that CF data is mapped to the current shape. This is because CF and SHP tags are siblings.

<?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>

This is useful, since it tells me the exact road shape and its corresponding traffic data.

This is not the case when the Flow Item is broken up into multiple segments. Here is a sample JSON that I'm working with:

...
{
    "FIS":[
        {
            "FI":[
                {
                    ...
                    "SHP":[
                        {
                            "value":[
                                "51.24274,7.13212 51.24311,7.13263 51.2432,7.13277 "
                            ],
                            "FC":3
                        },
                        {
                            "value":[
                                "51.2432,7.13277 51.24345,7.13314 51.24363,7.13346 51.24382,7.13381 51.24398,7.13408 51.24408,7.13423 51.24418,7.13436 "
                            ],
                            "FC":3
                        },
                    ...
                    ]
                    "CF":[
                        {
                            "SSS":{
                                "SS":[
                                    {
                                        "LE":1.07,
                                        "SP":50.0,
                                        "SU":52.63,
                                        "FF":49.18,
                                        "JF":0.0
                                    },
                                    {
                                        "LE":0.37,
                                        "SP":25.67,
                                        "SU":25.67,
                                        "FF":26.74,
                                        "JF":0.37504
                                    },
                                ...

As you can see, the CF segments are decoupled from the shape of the road, unlike the previous XML example.

Is there any way to interpret this data that couples traffic congestion with the shape of the road?

1

There are 1 best solutions below

0
On

Each traffic flow model consists of a location data of road segment represented in different location references (TMC, SHP) and a currentFlow (CF) field describing the current traffic conditions.

If there are different traffic conditions within same road segment, then sub segments (SS) are included to provide more granular traffic conditions while CF having aggregated information.

Data model for traffic flow does not provide location data for each subsegment, however it can be derived using length information available on subsegment SS. Example: Traverse to shape points until it matches subsegment length (preferred using percentile length as length may vary due to different map version or length calculated from shape points does not accurately match with map)then continuing it until last SSS