Select to view content in your preferred language

Where to Subscribe to Live Traffic Data and Adding Another Provider

6726
14
Jump to solution
09-11-2012 01:51 AM
FilipJung
Frequent Contributor
Hi,
I have a question regarding web services used to distribute Live Traffic data and generating DTF files. I have tried to look for this services both on NAVTEQ and TomTom websites and have not found anything.
I think that in documentation could be mentioned what type of service is it, so it could be easily searched. I tried to listen to web communication but target URLs have not given me any useful info.
Is it then some special service, which is not mentioned in Services/Products on provider's pages?

And another question is if would be posible to add our own service to list in Update Traffic Data Tool (do some configuration). Or is it only limited to listed providers? I am asking since our region is not in provided and we could have posibility to make such a service of our own.

Or would it be possible to make DTF file by ourselves?

Thanks much for answers and help.

Filip
Tags (2)
1 Solution

Accepted Solutions
PatrickStevens
Esri Contributor
Filip and I worked out the issues and his traffic information is working correctly now.  To summarize the important points:

- Be sure your TMC codes are 9 characters long with the following formatting:

   TMC is encoded as ABBCDDDDD
   A - Country code
   BB - Region code
   C - One character RDS direction: + - P N
   DDDDD - Location code

   Make sure that the A value is not zero.

- There are issues (before 10.1 SP2) with traffic data written in one date format (for example MM/DD/YYYY), then read in another format (DD/MM/YYYY).   SP2 will fix it, but prior to that, be sure to read and write in the same format.

- The ITrafficProvider API does not currently allow for setting the speed units to anything other than MPH.  I'm not sure when this will be fixed.  In the meantime, there are a couple of workarounds if you are using KPH:

   1) Manually convert the value in your feed from KPH to MPH before feeding it into the UpdateTraffic GP tool.  If your network is in KPH, the coversion from MPH in traffic files to KPH in the solver will happen automatically.

   2) Use the ITrafficDataManager API instead of ITrafficProvider.  What you gain is flexibility in how the traffic files are written, including setting the speed units.  What you lose is the ability to get your custom provider in the UpdateTraffic GP tool.

- VERY IMPORTANT.  As of now (not sure when it will be fixed), you are required to have historical traffic data to use live traffic.  If you don't have it, you have to fake it.  To fake it, you need a profiles table with 1 profile.  Set the scale factor for each time slice to 1.   You also need a Streets_Profiles join table to assign your fake profile to every street (as well as provide a base speed for the street segment).  Check out the San Diego tutorial data to see how it should all look.


--------------------------
Whew!  That is a lot of stuff.  Live traffic is really built to be used with supported vendor data.  To get it working with custom proprietary data takes some strange workarounds.  As people try this, when they have problems, please post them either in this thread or in a new forum thread. 

Thanks!

View solution in original post

14 Replies
PatrickStevens
Esri Contributor
Hi,
I have a question regarding web services used to distribute Live Traffic data and generating DTF files. I have tried to look for this services both on NAVTEQ and TomTom websites and have not found anything.
I think that in documentation could be mentioned what type of service is it, so it could be easily searched. I tried to listen to web communication but target URLs have not given me any useful info.
Is it then some special service, which is not mentioned in Services/Products on provider's pages?


The Update Traffic tools for incidents and speed data downloads are configured for NavTeq and TomTom already.  If you have a user name and password from those vendors, you can enter that in the GP tool.  Then, you'll be able to use a traffic enabled network dataset with the downloaded data.

To see the URLs used for the downloads, you can peek into the TrafficProviders.xml file.  It is at:

   <ArcGIS Install Directory>\NetworkAnalyst\NetworkConfiguration\TrafficProviders.xml

For me, that is:

  C:\Program Files (x86)\ArcGIS\Desktop10.1\NetworkAnalyst\NetworkConfiguration\TrafficProviders.xml



And another question is if would be posible to add our own service to list in Update Traffic Data Tool (do some configuration). Or is it only limited to listed providers? I am asking since our region is not in provided and we could have posibility to make such a service of our own.

Or would it be possible to make DTF file by ourselves?


Instructions for adding your service to the Update Traffic tool is here:

http://www.arcgis.com/home/item.html?id=e11126ea20e941bd9644046e62e2bdbe

If you have any trouble with using the tool, post here and I'll help out.
0 Kudos
FilipJung
Frequent Contributor
Dear Patrick,
thanks much for your help! I will try adding custom provider as described in sample you provided. I believe that with this you have taken a thorn out of my flesh. I will let you know when I manage to use it.
Filip
0 Kudos
FilipJung
Frequent Contributor
Dear Patrick,
I finally got myself to implement our CustomTrafficProvider. I get data from database so I adjusted code for that. Everything runs OK (data are loaded from DB, trafficRegionSpeedsStruct created and added to m_trafficRegionSpeedsList) but tool ends with this error:

ERROR 030103: Failed to update traffic data.
Invalid function arguments
Invalid function arguments
Failed to execute (UpdateTrafficData).


Do you have an idea of what could be wrong? I'm catching errors in code, but this error seems not to be in my code, since it is raised after all classes instances are created.

Thanks for help.

Filip
0 Kudos
FilipJung
Frequent Contributor
I'm sorry for false alarm, which it was, at least partially.
The cause was, that we had bad format TMC codes in our source database. After correcting to the right syntax, the tool runs successfully and the DTF file along with the TrafficIndex file are generated.

But in ArcMap, we do not see Live Traffic in our ND symbology, though we had time set up along with right time zone.
Is there any way to check that our DTF file is correct? Could it be problem that we write only one TimeSlice into m_timeSlices and only one speed speed in timeSliceSpeeds? Which means that we do not have predicted speeds.

Thanks for help.

Filip
0 Kudos
PatrickStevens
Esri Contributor
Getting the traffic to display in ArcMap can be a bit tricky.  You need to make sure that you have time enabled on the map and that the time settings are correct.

I'm probably missing some steps, but the general idea to check your traffic display is:

Make sure your network dataset layer is in the map, and set to display live traffic only (no historical).

Open up the time slider by clicking the little clock button on the main toolbar

Click the options button on the time slider

On the Time Display tab, be sure to correctly set your time zone.  This is very important.

On the Time Extent tab, I usually set the full time extent to <Undefined>, then fill in a start and end time that more than covers the extent of my traffic data.

Here is a very important part:  The DTFs and TrafficIndex.xml files all use UTC time.  Check inside TrafficIndex.xml and look at the time that is the DTF file name.  If you have properly set your time zone on the time slider, you should see live traffic if the time slider time is offset by the proper amount from UTC.

  A quick test is to set the time zone on the slider to UTC, then set the time to be just after the start time of one of your DTFs.



I hope this helps,

Patrick
FilipJung
Frequent Contributor
Hi Patrick,
I tried the way that you described but was not successfull even when playing with time settings in many ways.

When I checked my TrafficIndex.xml file, all time values seemed to by in our local time (UTC +1). I suppose that it is caused by setting m_timestamp = DateTime.Now in EnumTrafficSpeeds. So I converted DateTime.Now using ToUniversalTime() and times in TrafficIndex.xml file and also name of created dtf file changed to UTC time. Unfortunately not even this helped to bring the live data into display.

One thing that I discovered is that if I set the time on in ArcMap and go to the time covered by my DTF file and then try to delete that DTF file on disk, there is a protection against deleting even for an administrator. After ArcMap is closed I was able to delete the file. So this could probably prove that DTF file is accesed by ArcMap, but as it seems, no values are loaded from it. I'm quiet sure, that TMC codes and speeds are correct.

Do you know about any reason why it does not work?

Thanks.

Filip
0 Kudos
PatrickStevens
Esri Contributor
Hello, Filip,

Do you think I could see your TrafficIndex.xml and an associated DTF?  If so, please zip it up and send it to pstevens at esri.com.

I'm not sure if the problem is in the traffic files, in the ArcMap time settings, or in the network dataset traffic tables.  If I don't see anything obvious in the traffic files, we'll take a look at the network. 

Also, if you need a fast response, you can contact support.

Thanks, and sorry that you are having such difficulties!
0 Kudos
PatrickStevens
Esri Contributor
Filip and I worked out the issues and his traffic information is working correctly now.  To summarize the important points:

- Be sure your TMC codes are 9 characters long with the following formatting:

   TMC is encoded as ABBCDDDDD
   A - Country code
   BB - Region code
   C - One character RDS direction: + - P N
   DDDDD - Location code

   Make sure that the A value is not zero.

- There are issues (before 10.1 SP2) with traffic data written in one date format (for example MM/DD/YYYY), then read in another format (DD/MM/YYYY).   SP2 will fix it, but prior to that, be sure to read and write in the same format.

- The ITrafficProvider API does not currently allow for setting the speed units to anything other than MPH.  I'm not sure when this will be fixed.  In the meantime, there are a couple of workarounds if you are using KPH:

   1) Manually convert the value in your feed from KPH to MPH before feeding it into the UpdateTraffic GP tool.  If your network is in KPH, the coversion from MPH in traffic files to KPH in the solver will happen automatically.

   2) Use the ITrafficDataManager API instead of ITrafficProvider.  What you gain is flexibility in how the traffic files are written, including setting the speed units.  What you lose is the ability to get your custom provider in the UpdateTraffic GP tool.

- VERY IMPORTANT.  As of now (not sure when it will be fixed), you are required to have historical traffic data to use live traffic.  If you don't have it, you have to fake it.  To fake it, you need a profiles table with 1 profile.  Set the scale factor for each time slice to 1.   You also need a Streets_Profiles join table to assign your fake profile to every street (as well as provide a base speed for the street segment).  Check out the San Diego tutorial data to see how it should all look.


--------------------------
Whew!  That is a lot of stuff.  Live traffic is really built to be used with supported vendor data.  To get it working with custom proprietary data takes some strange workarounds.  As people try this, when they have problems, please post them either in this thread or in a new forum thread. 

Thanks!
BrittanyBurson2
Emerging Contributor

Hello Patrick, I've been looking around the web for some kind of data dictionary or schema for the TMC codes -- for example you state the TMC is encoded as ABBCDDDDD, where  A = Country code and BB = Region code. I can't seem to find a reference of what codes to use anywhere, but I see in the network dataset tutorial data uses 106 for San Diego. Is there a list of country or region codes documented somewhere?


Thank you!

0 Kudos