# TrafficIndex **Repository Path**: futurewwm/TrafficIndex ## Basic Information - **Project Name**: TrafficIndex - **Description**: TTI( Travel Time Index)是业内使用较多的城市拥堵程度的评价指标,是反应实际花费的行程时间与自由流花费行程时间的比值关系,值越大表示交通运行状态越差,一般与拥堵程度正相关,其它如异常天气(如雨、雪、雾等)或者异常道路情况也可能对TTI的数值产生影响。高德、百度、滴滴、世纪高通、tomtom均有城市交通指数发布平台,每家的具体计算方法并不公开。基于浮动车轨迹的城市交通指数计算服务, - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2020-06-04 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TTI ,Smart Transportation Industry Standard! [![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/didichuxing/TrafficIndex/blob/master/LICENSE) [![Release Version](https://img.shields.io/badge/release-0.9.8-red.svg)] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)] The TTI (Travel Time Index) industry's most used evaluation index of urban congestion degree is the ratio of the actual travel time and the free flow time. The larger the value, the worse the traffic operation status, and the congestion level is generally positive. Related, other abnormal weather conditions (such as rain, snow, fog, etc.) or abnormal road conditions may also affect the value of TTI. # Basic Idea the basic idea of Speed: If a link has two time slices, t1 and t2, and the link's length is S, then the average speed v of the link is: v = 2·S / (t1 + t2) during the period from t1 to t2. the basic idea of TTI: In the same link in a time slice, tti = free flow speed / actual speed. # Calculation method of traffic index ![TTI](method.jpg) # Data curves of Beijing and Urumqi ![TTI](demo.jpg) # Required data | Feature | Detail | |:-------------|:-------------:| | Road network data | Basic map road network data, including road shape and unique id | | Realtime Traffic data | Relying on dripping massive floating car data, real-time traffic data released by Didi | | Free flow data | From the Drip Trajectory database, the road speed generated by the excavation | | weight data | The total number of vehicles passing the road within a natural month | # Getting started ## GAIA Open Dataset With DiDi's advantages in big data and technology, the GAIA Initiative provides academic community with real-life application use cases, anonymized data and computing resources, and seeks collaboration with the academic community. The Initiative aims to advance fundamental and prospective studies in transportation research. It promotes the application of scientific achievements by strengthening ties between industry, university and research. This effort will drive scientific development in intelligent transportation systems and contribute to societal development.With DiDi's advantages in big data and technology, the GAIA Initiative provides academic community with real-life application use cases, anonymized data and computing resources, and seeks collaboration with the academic community. The Initiative aims to advance fundamental and prospective studies in transportation research. It promotes the application of scientific achievements by strengthening ties between industry, university and research. This effort will drive scientific development in intelligent transportation systems and contribute to societal development. Add a realtime traffic data API in `config.conf` in root of host project as following. ``` c++ dependencies { realtime_traffic_data 'http://sts.didichuxing.com/api/realtime?citycode=1&token=your token' roadnet 'http://sts.didichuxing.com/api/roadnet?citycode=1&token=your token' freeflow 'http://sts.didichuxing.com/api/freeflow?link_id=10001&token=your token' weight 'http://sts.didichuxing.com/api/weight?link_id=10001&token=your token' } ``` In addition, you need to configure redis、mysql # Compile c++ program g++ -o TrafficIndex CommonTools.cpp LogUlits.cpp main.cpp md5.cpp TrafficIndex.cpp traffic_pb.pb.cc -lmysqlclient -lpq -I/usr/include/mysql -L/usr/lib64/mysql -I/usr/include -L/usr/lib64 -I/usr/local/protobuf/include -L/usr/local/protobuf/lib -I/usr/local/include/hiredis -L/usr/local/lib -I/usr/local/postgresql-9.6.6/include -L/usr/local/postgresql-9.6.6/lib -I/usr/local/leveldb -luuid -lpthread -lprotobuf -lhiredis -lcurl -lleveldb Finally, Get executable program TrafficIndex Start the calculation program like this: nohup ./TrafficIndex & # Known issues * Only supports the data format of DIDI, other data types are not supported. * Need to apply for open data from DIDI. # Contributing Welcome to contribute by creating issues or sending pull requests. See [Contributing Guide](CONTRIBUTING.md) for guidelines. # Who is using TTI? 滴滴出行 Uber中国 # License TTI is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file.