SlideShare a Scribd company logo
Submitted By: Chandrasekar Hariharan & Vaikunth Sridharan
MENTOR: PRAMOD ANANTHARAMAN
CITY TRAFFIC EVENT
AGGREGATION AND
VISUALIZING SERVICE
WRIGHT STATE UNIVERSITY
CS 7800 WEB INFORMATION SYSTEMS
 City Traffic Event Aggregation and Visualizing Service
 Page 1
`City Traffic Event
Aggregation and
Visualizing Service
Goal:
Visualize Events responsible for abnormal
traffic pattern on a given traffic scenario.
1. Abstract:
In this project, we will analyze various traffic data
sources and event data sources to better explain
the reason for any particular congestion. Data
sources are split up in to two kinds, traffic data and
event data. Congestion factor, traffic speed and
link volume are three significant attributes which
better describes traffic variations. Weather data,
Active & Scheduled events data, etc. are some
data sources which gives the events that occur at
traffic variations in terms of those attributes.
Collecting this information from various sources,
aggregating the same, updating it on database,
further creating a visualization approach for city
events for better describing abnormal traffic
behavior and using the same for further research
analysis are the key elements of this project.
2. Introduction:
Recently traffic has enormously increased in city
areas, making it tedious and drawn-out for the
public to commute [1]. Average commute rate on
bay area is 30 percent longer than it was a year
and half ago [2]. They drivers in bay area spend
more time stuck in traffic than commuting. The
classical theory of traffic flow describes two traffic
phases: the uncongested phase or free flow phase,
and the congested phase [3]. Joint measurements
of speed and flow gathered in a learning phase,
are useful in validating the traffic flow data results
[3]. There is an inverse proportion between speeds
of a traffic flow and congestion [3].
With the help of existing traffic flow data,
predicting traffic for the next 15 to 30 minutes is
80 percent accurate [4]. Constructing a knowledge
base using incident reports, weather data, event
scenarios nearby, can serve as useful source of
information for learning, constructing traffic
models and predicting traffic flow in addition to
flow data [5].
Based on the information from the above data
sources, in this project, we develop aggregation
Figure 1: Individual speed variance in traffic flow [3]
Figure 2: Required data sources for analysis [4]
 City Traffic Event Aggregation and Visualizing Service
 Page 2
and visualization mechanisms from the existing
data sources. The data sources selected,
aggregation and visualization architecture are
explained below.
3. Objectives
The goal of this project is to aggregate data from
diversified data sources based on location and
timestamp to visualize spatial and thematic data.
List of objectives to accomplish the suggested
goal is listed below:
3.1 Finding Possible Data sources
Social tweets, popular events nearby, weather in a
location, traffic incidents in a network are key data
sources which affect the traffic flow in a given
traffic link [5]. Reliability, credibility, data accuracy
are some key factors in selecting the right data.
Based on all these factors, we have chosen five
API’s which offers reliable services and accurate
information regarding the data requested. The
sources are Eventful, Eventbrite, Openweathermap
and Here maps flow and incident rest API’s.
3.2 Aggregating Data sources
These data sources collected from the above
mentioned API’s are aggregated together by time
and location. At any given instance and any given
location, aggregated table gives the values of all
the events possibly occurred which has an impact
on the traffic. In this project, we aim to aggregate
the data sources and give the results for further
investigation. Learning, forecasting the traffic and
finding the cause of an incident are out of scope.
By aggregating the data, user can search for all the
events bound to a timeline, thereby our data
aggregated, can serve as the data source for many
traffic related predictions using statistical
inferences or machine learning techniques.
3.3 Storing Thematic Data
The data obtained from the server is stored in the
database for every particular time interval. Incident
data, flow data and weather data are subjected to
change every now and then. Hence storing this
data for future analysis is a must. Writing a shell
script, which fetches the data from the API and
updating the database for particular time interval
is this objective.
3.4 Visualizing a Scenario
Visualizing the data obtained from various data
sources in the maps is this objective. The user
selects the location and corresponding timeline
for obtaining the events occurred. This request is
forwarded to the server, which in turn returns the
values collected from the server according to
user’s request. For every time range, the events
may vary. At a timeline, user can graphically view
what traffic incidents have happened, the events
occurred at that similar time when the incidents
happened. This data can be used for future
analysis to obtain any relation of parameters
collected.
4. Data Source Description
4.1 Scheduled Event Sources:
4.1.1 Eventful API
This API has world’s largest collection of events,
which ranges from local to global events. Venues
and events can be searched in this API. It uses REST
based calling scheme. A private application key
has to be requested to obtain data from this data
source.
 City Traffic Event Aggregation and Visualizing Service
 Page 3
Input Parameters:
1. Location latitude
2. Location longitude
3. From date and time
4. To date and time
Output Parameters:
Figure 3: Eventful Response Parameters
4.1.2 Eventbrite API
This website allows peoples to create and attend
events in around 190 countries. Tickets for most
of the events which occurs in big cities can be
bought through this website. This website gives
an approximation of attendance present for an
event. With this as a data source, information
about popular events occurring near the area can
be retrieved for analysis.
Input Parameters:
1. Location latitude
2. Location longitude
3. From date and time
4. To date and time
Output Parameters:
Figure 4: Eventbrite Response Parameters
4.2 Active Event Sources:
4.2.1 Open Weather API
This API gives us information about weather of a
location. Weather has major impact on traffic
conditions and incidents which could possibly
happen in road. It has also been observed that
during severe snow conditions the traffic demand
also drops significantly and the congestion on
the freeway disappears [6]. Based on the
research carried out [6], there is a significant drop
in traffic volume in snowy conditions but there
was observed a significant increase in traffic
congestion. Dampen conditions significantly
contribute to traffic congestion in peak areas [6].
Increased traffic congestion and decreased traffic
volume was observed in city areas during wet
traffic conditions [6]. Hence it is important to
consider weather data for analyzing traffic.
Input Parameter: Location
 City Traffic Event Aggregation and Visualizing Service
 Page 4
Output Parameter:
Figure 5: Open weather data Response
Parameters
4.2.2 Here Incident API
Constructions and Accidents play a major role in
affecting the flow of traffic thereby contributing to
the increased traffic congestion. Accident rate is a
complex characteristic of “road-vehicle-driver-
road environment” system [7]. From the research
[7], we could conclude that there is a direct
relationship between accident rate and traffic
volume.
From the figure 6, it can be observed that there is
a significant decrease in traffic volume when there
is increased accident density. Hence monitoring
accident data for traffic accidents gives us insights
on abnormal traffic.
Figure 6: Relationship between traffic volume and
accidents [8]
Construction events occurring in a location will
increase the traffic congestion by making it jam-
packed on a link, as it will reduce the number of
routes to destination [8]. Hence monitoring
construction events is necessary for analyzing the
traffic flow. Here API gives information about
traffic accidents and construction around a
location.
Input Parameters: Location & Bounding Box
Output Parameters:
Figure 7: Here Incidents data Response
 City Traffic Event Aggregation and Visualizing Service
 Page 5
4.3 Flow Data Sources:
4.3.1 Here Flow API
From the research made [4], traffic flow data
accounts for 80 percent of traffic prediction. This
flow data is collected from various sensors kept
at many spots in the city. Here API collects this
flow data and sends it to the person who
requests via REST calls.
Input Parameters: Location & Bounding Box
Output Parameters:
Figure 8: Here Flow API data response
Terms and Explanation
 PC- Point Location Code
 DE - Description of Road
 QD -Queuing direction. '+' or '-'. Note
this is the opposite of the travel direction
in the fully qualified ID, for example for
location 107+03021 the QD would be '-'.
 LE - Length of the stretch of road
 JF - Jamming Factor
 CN- Confidence, an indication of how the
speed was determined. -1.0 road closed.
1.0=100% 0.7-100% Historical Usually a
value between .7 and 1.0.
 FF - The free flow speed on this stretch of
road.
 SP - Speed (based on UNITS) capped by
speed limit
 SU-Speed (based on UNITS) not capped
by speed limit
4.3.2 511 Data
This data source gives real time traffic information
about San Francisco Bay Area. Incident,
construction details, information about a link, real
time updates on traffic data are gathered from this
information source. From this data source, we
obtain the speed vs volume parameters which
could be a sensitive information in traffic
prediction.
Input Parameters: Location and Timestamp
Output Parameters:
Figure 9: 511 Data response
 City Traffic Event Aggregation and Visualizing Service
 Page 6
System Architecture
Complete Architecture
Below described is the complete system
architecture. Events from multiple event sources
are recorded. They are aggregated and visualized
based on time.
Data sources are classified into Event sources and
Traffic sources. Traffic data sources provide real
time traffic information and flow information in an
area. Event sources provide information about the
events which are occuring in a particular area.
Collecting data from these datasources, storing it
locally in a MySQL database dynamically for future
analysis is one main theme of this project.
JSON, a lightweight data-interchange format, is
used to fetch information from data source
providers. User, environmental and traffic sensitive
information over a thematic timeline is retrieved
and stored.
User selects his timeline and searches for all the
evens that have occured in that particular timeline.
Map based visualization is facilitated whereby user
can delve around the screen to locate the
corresponding event pushpin and perform
historical data analysis on events which have
occurred in the past.
Server, which handles requests from the user to
fetch the values from the database, filters the
search according to user’s input and delivers the
required event in JSON format back to handle.
Javascript handles the data returned from the
server effectively and plots the event values on the
map. Latitude, Longitude and event description
are main fields which will plots the correct event
description on to pushpin.
Figure 10: System Architecture for Event Data Aggregation & Visualization
 City Traffic Event Aggregation and Visualizing Service
 Page 7
A script which continuosly stores the events from
API calls to the database executes as a cron job in
the server. This cron job collects information about
a particular event, parses the information and
stores the required parameters on to the database.
Front-End Description
In this Project, we have used many Java script
plug-ins such as JQuery UI, Raphael, Moment, and
Here API. User sends his request via AJAX calls to
the server, requesting for data. Server gives the
data requested in JSON format to the user. Push
pins and text are plotted based on the response
obtained from the server. Bootstrap css framework
is used extensively to adapt this website for mobile
devices. By this user interface, the user can easily
identify the events tagged in a location. Scrollable
timeline panel gives user the ease of seeing the
events based on time.
Back-End Description
Server fetches the data from the event provider via
API calls. Obtained JSON string is parsed and
updated in to the database. This sequence
happens as a cron job thereby updating the events
dynamically on a specified time interval. The
location and timestamp is set as primary key, these
two parameters distinguishes an event from all
other events. Recording Latitude and Longitude
data is very useful, for obtaining accurate
information about a location and for plotting the
event in the map. MYSQL is used as the database
to store all the active and scheduled events.
Implementation
HTML, CSS, JAVASCRIPT are three primary
languages used for developing visualization. We
have used PHP in apache server to process the
request from the clients and dynamically update
the database about current events.
User supplies AJAX request to the server
requesting for events which happened with in a
date range. Server searches for events which are
within the date range in the database. It returns
user’s request with the events recorded. The server
returns the events obtained to the user in a JSON
format. List of POPO (Plain Old PHP Objects)
objects retrieved from the database are converted
to json format. JSON response is sent back to the
user to visualize events.
Cron jobs are scheduled to retrieve the data from
API and insert in to the MYSQL database. Traffic
information and event information are
dynamically requested to the respective data
sources. Response from the data sources are
parsed from the PHP server and are updated in to
the database.
Below is the diagram of outline of system’s
implementation.
Figure 11: System Outline
 City Traffic Event Aggregation and Visualizing Service
 Page 8
Snapshots:
Figure 12: User Interface Snap Shot
Figure 13: SERVER (PHP) CODE
 City Traffic Event Aggregation and Visualizing Service
 Page 9
Conclusion:
We have implemented the proposed architecture
to store and visualize the events based on a
timeline. This collection of events, can be used to
predict future traffic based on a statistical analysis,
alert the individuals about a link which is crowded
and can be used to find root cause analysis for
events. As traffic congestion is a major problem in
crowded cities, this tool can be used as an effective
way to visualize ongoing event information and
take better decisions based on the same.
Instructions to execute
Back end:
1. Install XAMPP control panel tool by Apache for
using MySQL and Apache Server.
2. After installation, copy the PHP Folder
(containing PHP files) to <XAMPP
Directory>/htdocs/
3. Open your XAMPP Control Panel > Start
Apache & MySQL Servers.
4. You can now execute the PHP files from the
browser by typing
http://localhost/<PHPFolderName>. Remember
that this is the Folder which you had copied to
htdocs before.
Figure 14: Database Snapshot
 City Traffic Event Aggregation and Visualizing Service
 Page 10
Front end:
1. Copy the Client side folder to the same
XAMPP directory <XAMPP
Directory>/htdocs/
2. The Client Side User Interface is now
accessible in
http://localhost/<ClientFolderName>.
Keep in mind that this is the same folder
where you had copied and pasted both
your Client Side Folder and PHP Folder.
The directory location should be like the
above hierarchy.
References
1. http://research.microsoft.com/en-
us/projects/clearflow/default.aspx
2. http://www.fox10phoenix.com/story/278
42935/traffic-analytics-company-says-
average-bay-area-commute-times-are-
increasing
3. http://bayen.eecs.berkeley.edu/sites/defa
ult/files/conferences/Blandin_Salam_Baye
n_TRB12.pdf
4. http://venturebeat.com/2015/04/03/how
-microsofts-using-big-data-to-predict-
traffic-jams-up-to-an-hour-in-advance/
5. Horvitz, E. J., Apacible, J., Sarin, R., & Liao,
L. (2012). Prediction, expectation, and
surprise: Methods, designs, and study of a
deployed traffic forecasting service. arXiv
preprint arXiv:1207.1352.
6. http://www.d.umn.edu/cs/thesis/lalit_noo
kala_ms.pdf
7. http://www.balticroads.org/downloads/2
5BRC/25brc_d1_pakalnis_1.pdf
8. http://www.dot.state.mn.us/d3/projects/i
nterregionalconnection/pdfs/final/Chapt
er9.pdf
9. https://www.eventbrite.com/
10. http://lexington.eventful.com/events
11. https://developer.here.com/rest-apis
12. http://openweathermap.org/
 City Traffic Event Aggregation and Visualizing Service
 Page 11

More Related Content

Similar to Final_Report

Project on nypd accident analysis using hadoop environment
Project on nypd accident analysis using hadoop environmentProject on nypd accident analysis using hadoop environment
Project on nypd accident analysis using hadoop environment
Siddharth Chaudhary
 
Trisul netflow isp_features
Trisul netflow isp_featuresTrisul netflow isp_features
Trisul netflow isp_features
trisulnsm
 
Density of route frequency for enforcement
Density of route frequency for enforcement Density of route frequency for enforcement
Density of route frequency for enforcement
Conference Papers
 
Certain Analysis on Traffic Dataset based on Data Mining Algorithms
Certain Analysis on Traffic Dataset based on Data Mining AlgorithmsCertain Analysis on Traffic Dataset based on Data Mining Algorithms
Certain Analysis on Traffic Dataset based on Data Mining Algorithms
IRJET Journal
 
Flight delay detection data mining project
Flight delay detection data mining projectFlight delay detection data mining project
Flight delay detection data mining project
Akshay Kumar Bhushan
 
Locations big data its
Locations big data itsLocations big data its
Locations big data its
GeoMedeelel
 
RITMAN2012-kun
RITMAN2012-kunRITMAN2012-kun
RITMAN2012-kun
Kun-Yen Tsai
 
procedure for crime prevention and environmental degradation.pptx
procedure for crime prevention and environmental degradation.pptxprocedure for crime prevention and environmental degradation.pptx
procedure for crime prevention and environmental degradation.pptx
IsMaiRa2
 
Mining data for traffic detection system
Mining data for traffic detection systemMining data for traffic detection system
Mining data for traffic detection system
ijccsa
 
Visualizing CDR Data
Visualizing CDR DataVisualizing CDR Data
Visualizing CDR Data
NopphawanTamkuan
 
Decentralized system to compute safest route - Report
Decentralized system to compute safest route - ReportDecentralized system to compute safest route - Report
Decentralized system to compute safest route - Report
Anushka Patil
 
Smart City Surveillance Running on Vehicles
Smart City Surveillance Running on VehiclesSmart City Surveillance Running on Vehicles
Smart City Surveillance Running on Vehicles
Ma'ayan Doron
 
Mr. Paul Chang's presentation at QITCOM 2011
Mr. Paul Chang's presentation at QITCOM 2011Mr. Paul Chang's presentation at QITCOM 2011
Mr. Paul Chang's presentation at QITCOM 2011
QITCOM
 
Ws For Aq
Ws For AqWs For Aq
Ws For Aq
Rudolf Husar
 
IRJET- Traffic Prediction Techniques: Comprehensive analysis
IRJET- Traffic Prediction Techniques: Comprehensive analysisIRJET- Traffic Prediction Techniques: Comprehensive analysis
IRJET- Traffic Prediction Techniques: Comprehensive analysis
IRJET Journal
 
Real time deep-learning based traffic volume count for high-traffic urban art...
Real time deep-learning based traffic volume count for high-traffic urban art...Real time deep-learning based traffic volume count for high-traffic urban art...
Real time deep-learning based traffic volume count for high-traffic urban art...
Conference Papers
 
IRJET- Accident Information Mining and Insurance Dispute Resolution
IRJET- Accident Information Mining and Insurance Dispute ResolutionIRJET- Accident Information Mining and Insurance Dispute Resolution
IRJET- Accident Information Mining and Insurance Dispute Resolution
IRJET Journal
 
IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...
IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...
IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...
IRJET Journal
 
IRJET- Web Traffic Analysis through Data Analysis and Machine Learning
IRJET- Web Traffic Analysis through Data Analysis and Machine LearningIRJET- Web Traffic Analysis through Data Analysis and Machine Learning
IRJET- Web Traffic Analysis through Data Analysis and Machine Learning
IRJET Journal
 
20558-38937-1-PB.pdf
20558-38937-1-PB.pdf20558-38937-1-PB.pdf
20558-38937-1-PB.pdf
IjictTeam
 

Similar to Final_Report (20)

Project on nypd accident analysis using hadoop environment
Project on nypd accident analysis using hadoop environmentProject on nypd accident analysis using hadoop environment
Project on nypd accident analysis using hadoop environment
 
Trisul netflow isp_features
Trisul netflow isp_featuresTrisul netflow isp_features
Trisul netflow isp_features
 
Density of route frequency for enforcement
Density of route frequency for enforcement Density of route frequency for enforcement
Density of route frequency for enforcement
 
Certain Analysis on Traffic Dataset based on Data Mining Algorithms
Certain Analysis on Traffic Dataset based on Data Mining AlgorithmsCertain Analysis on Traffic Dataset based on Data Mining Algorithms
Certain Analysis on Traffic Dataset based on Data Mining Algorithms
 
Flight delay detection data mining project
Flight delay detection data mining projectFlight delay detection data mining project
Flight delay detection data mining project
 
Locations big data its
Locations big data itsLocations big data its
Locations big data its
 
RITMAN2012-kun
RITMAN2012-kunRITMAN2012-kun
RITMAN2012-kun
 
procedure for crime prevention and environmental degradation.pptx
procedure for crime prevention and environmental degradation.pptxprocedure for crime prevention and environmental degradation.pptx
procedure for crime prevention and environmental degradation.pptx
 
Mining data for traffic detection system
Mining data for traffic detection systemMining data for traffic detection system
Mining data for traffic detection system
 
Visualizing CDR Data
Visualizing CDR DataVisualizing CDR Data
Visualizing CDR Data
 
Decentralized system to compute safest route - Report
Decentralized system to compute safest route - ReportDecentralized system to compute safest route - Report
Decentralized system to compute safest route - Report
 
Smart City Surveillance Running on Vehicles
Smart City Surveillance Running on VehiclesSmart City Surveillance Running on Vehicles
Smart City Surveillance Running on Vehicles
 
Mr. Paul Chang's presentation at QITCOM 2011
Mr. Paul Chang's presentation at QITCOM 2011Mr. Paul Chang's presentation at QITCOM 2011
Mr. Paul Chang's presentation at QITCOM 2011
 
Ws For Aq
Ws For AqWs For Aq
Ws For Aq
 
IRJET- Traffic Prediction Techniques: Comprehensive analysis
IRJET- Traffic Prediction Techniques: Comprehensive analysisIRJET- Traffic Prediction Techniques: Comprehensive analysis
IRJET- Traffic Prediction Techniques: Comprehensive analysis
 
Real time deep-learning based traffic volume count for high-traffic urban art...
Real time deep-learning based traffic volume count for high-traffic urban art...Real time deep-learning based traffic volume count for high-traffic urban art...
Real time deep-learning based traffic volume count for high-traffic urban art...
 
IRJET- Accident Information Mining and Insurance Dispute Resolution
IRJET- Accident Information Mining and Insurance Dispute ResolutionIRJET- Accident Information Mining and Insurance Dispute Resolution
IRJET- Accident Information Mining and Insurance Dispute Resolution
 
IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...
IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...
IRJET- Monitoring and Analysing Real Time Traffic Images and Information Via ...
 
IRJET- Web Traffic Analysis through Data Analysis and Machine Learning
IRJET- Web Traffic Analysis through Data Analysis and Machine LearningIRJET- Web Traffic Analysis through Data Analysis and Machine Learning
IRJET- Web Traffic Analysis through Data Analysis and Machine Learning
 
20558-38937-1-PB.pdf
20558-38937-1-PB.pdf20558-38937-1-PB.pdf
20558-38937-1-PB.pdf
 

Final_Report

  • 1. Submitted By: Chandrasekar Hariharan & Vaikunth Sridharan MENTOR: PRAMOD ANANTHARAMAN CITY TRAFFIC EVENT AGGREGATION AND VISUALIZING SERVICE WRIGHT STATE UNIVERSITY CS 7800 WEB INFORMATION SYSTEMS
  • 2.  City Traffic Event Aggregation and Visualizing Service  Page 1 `City Traffic Event Aggregation and Visualizing Service Goal: Visualize Events responsible for abnormal traffic pattern on a given traffic scenario. 1. Abstract: In this project, we will analyze various traffic data sources and event data sources to better explain the reason for any particular congestion. Data sources are split up in to two kinds, traffic data and event data. Congestion factor, traffic speed and link volume are three significant attributes which better describes traffic variations. Weather data, Active & Scheduled events data, etc. are some data sources which gives the events that occur at traffic variations in terms of those attributes. Collecting this information from various sources, aggregating the same, updating it on database, further creating a visualization approach for city events for better describing abnormal traffic behavior and using the same for further research analysis are the key elements of this project. 2. Introduction: Recently traffic has enormously increased in city areas, making it tedious and drawn-out for the public to commute [1]. Average commute rate on bay area is 30 percent longer than it was a year and half ago [2]. They drivers in bay area spend more time stuck in traffic than commuting. The classical theory of traffic flow describes two traffic phases: the uncongested phase or free flow phase, and the congested phase [3]. Joint measurements of speed and flow gathered in a learning phase, are useful in validating the traffic flow data results [3]. There is an inverse proportion between speeds of a traffic flow and congestion [3]. With the help of existing traffic flow data, predicting traffic for the next 15 to 30 minutes is 80 percent accurate [4]. Constructing a knowledge base using incident reports, weather data, event scenarios nearby, can serve as useful source of information for learning, constructing traffic models and predicting traffic flow in addition to flow data [5]. Based on the information from the above data sources, in this project, we develop aggregation Figure 1: Individual speed variance in traffic flow [3] Figure 2: Required data sources for analysis [4]
  • 3.  City Traffic Event Aggregation and Visualizing Service  Page 2 and visualization mechanisms from the existing data sources. The data sources selected, aggregation and visualization architecture are explained below. 3. Objectives The goal of this project is to aggregate data from diversified data sources based on location and timestamp to visualize spatial and thematic data. List of objectives to accomplish the suggested goal is listed below: 3.1 Finding Possible Data sources Social tweets, popular events nearby, weather in a location, traffic incidents in a network are key data sources which affect the traffic flow in a given traffic link [5]. Reliability, credibility, data accuracy are some key factors in selecting the right data. Based on all these factors, we have chosen five API’s which offers reliable services and accurate information regarding the data requested. The sources are Eventful, Eventbrite, Openweathermap and Here maps flow and incident rest API’s. 3.2 Aggregating Data sources These data sources collected from the above mentioned API’s are aggregated together by time and location. At any given instance and any given location, aggregated table gives the values of all the events possibly occurred which has an impact on the traffic. In this project, we aim to aggregate the data sources and give the results for further investigation. Learning, forecasting the traffic and finding the cause of an incident are out of scope. By aggregating the data, user can search for all the events bound to a timeline, thereby our data aggregated, can serve as the data source for many traffic related predictions using statistical inferences or machine learning techniques. 3.3 Storing Thematic Data The data obtained from the server is stored in the database for every particular time interval. Incident data, flow data and weather data are subjected to change every now and then. Hence storing this data for future analysis is a must. Writing a shell script, which fetches the data from the API and updating the database for particular time interval is this objective. 3.4 Visualizing a Scenario Visualizing the data obtained from various data sources in the maps is this objective. The user selects the location and corresponding timeline for obtaining the events occurred. This request is forwarded to the server, which in turn returns the values collected from the server according to user’s request. For every time range, the events may vary. At a timeline, user can graphically view what traffic incidents have happened, the events occurred at that similar time when the incidents happened. This data can be used for future analysis to obtain any relation of parameters collected. 4. Data Source Description 4.1 Scheduled Event Sources: 4.1.1 Eventful API This API has world’s largest collection of events, which ranges from local to global events. Venues and events can be searched in this API. It uses REST based calling scheme. A private application key has to be requested to obtain data from this data source.
  • 4.  City Traffic Event Aggregation and Visualizing Service  Page 3 Input Parameters: 1. Location latitude 2. Location longitude 3. From date and time 4. To date and time Output Parameters: Figure 3: Eventful Response Parameters 4.1.2 Eventbrite API This website allows peoples to create and attend events in around 190 countries. Tickets for most of the events which occurs in big cities can be bought through this website. This website gives an approximation of attendance present for an event. With this as a data source, information about popular events occurring near the area can be retrieved for analysis. Input Parameters: 1. Location latitude 2. Location longitude 3. From date and time 4. To date and time Output Parameters: Figure 4: Eventbrite Response Parameters 4.2 Active Event Sources: 4.2.1 Open Weather API This API gives us information about weather of a location. Weather has major impact on traffic conditions and incidents which could possibly happen in road. It has also been observed that during severe snow conditions the traffic demand also drops significantly and the congestion on the freeway disappears [6]. Based on the research carried out [6], there is a significant drop in traffic volume in snowy conditions but there was observed a significant increase in traffic congestion. Dampen conditions significantly contribute to traffic congestion in peak areas [6]. Increased traffic congestion and decreased traffic volume was observed in city areas during wet traffic conditions [6]. Hence it is important to consider weather data for analyzing traffic. Input Parameter: Location
  • 5.  City Traffic Event Aggregation and Visualizing Service  Page 4 Output Parameter: Figure 5: Open weather data Response Parameters 4.2.2 Here Incident API Constructions and Accidents play a major role in affecting the flow of traffic thereby contributing to the increased traffic congestion. Accident rate is a complex characteristic of “road-vehicle-driver- road environment” system [7]. From the research [7], we could conclude that there is a direct relationship between accident rate and traffic volume. From the figure 6, it can be observed that there is a significant decrease in traffic volume when there is increased accident density. Hence monitoring accident data for traffic accidents gives us insights on abnormal traffic. Figure 6: Relationship between traffic volume and accidents [8] Construction events occurring in a location will increase the traffic congestion by making it jam- packed on a link, as it will reduce the number of routes to destination [8]. Hence monitoring construction events is necessary for analyzing the traffic flow. Here API gives information about traffic accidents and construction around a location. Input Parameters: Location & Bounding Box Output Parameters: Figure 7: Here Incidents data Response
  • 6.  City Traffic Event Aggregation and Visualizing Service  Page 5 4.3 Flow Data Sources: 4.3.1 Here Flow API From the research made [4], traffic flow data accounts for 80 percent of traffic prediction. This flow data is collected from various sensors kept at many spots in the city. Here API collects this flow data and sends it to the person who requests via REST calls. Input Parameters: Location & Bounding Box Output Parameters: Figure 8: Here Flow API data response Terms and Explanation  PC- Point Location Code  DE - Description of Road  QD -Queuing direction. '+' or '-'. Note this is the opposite of the travel direction in the fully qualified ID, for example for location 107+03021 the QD would be '-'.  LE - Length of the stretch of road  JF - Jamming Factor  CN- Confidence, an indication of how the speed was determined. -1.0 road closed. 1.0=100% 0.7-100% Historical Usually a value between .7 and 1.0.  FF - The free flow speed on this stretch of road.  SP - Speed (based on UNITS) capped by speed limit  SU-Speed (based on UNITS) not capped by speed limit 4.3.2 511 Data This data source gives real time traffic information about San Francisco Bay Area. Incident, construction details, information about a link, real time updates on traffic data are gathered from this information source. From this data source, we obtain the speed vs volume parameters which could be a sensitive information in traffic prediction. Input Parameters: Location and Timestamp Output Parameters: Figure 9: 511 Data response
  • 7.  City Traffic Event Aggregation and Visualizing Service  Page 6 System Architecture Complete Architecture Below described is the complete system architecture. Events from multiple event sources are recorded. They are aggregated and visualized based on time. Data sources are classified into Event sources and Traffic sources. Traffic data sources provide real time traffic information and flow information in an area. Event sources provide information about the events which are occuring in a particular area. Collecting data from these datasources, storing it locally in a MySQL database dynamically for future analysis is one main theme of this project. JSON, a lightweight data-interchange format, is used to fetch information from data source providers. User, environmental and traffic sensitive information over a thematic timeline is retrieved and stored. User selects his timeline and searches for all the evens that have occured in that particular timeline. Map based visualization is facilitated whereby user can delve around the screen to locate the corresponding event pushpin and perform historical data analysis on events which have occurred in the past. Server, which handles requests from the user to fetch the values from the database, filters the search according to user’s input and delivers the required event in JSON format back to handle. Javascript handles the data returned from the server effectively and plots the event values on the map. Latitude, Longitude and event description are main fields which will plots the correct event description on to pushpin. Figure 10: System Architecture for Event Data Aggregation & Visualization
  • 8.  City Traffic Event Aggregation and Visualizing Service  Page 7 A script which continuosly stores the events from API calls to the database executes as a cron job in the server. This cron job collects information about a particular event, parses the information and stores the required parameters on to the database. Front-End Description In this Project, we have used many Java script plug-ins such as JQuery UI, Raphael, Moment, and Here API. User sends his request via AJAX calls to the server, requesting for data. Server gives the data requested in JSON format to the user. Push pins and text are plotted based on the response obtained from the server. Bootstrap css framework is used extensively to adapt this website for mobile devices. By this user interface, the user can easily identify the events tagged in a location. Scrollable timeline panel gives user the ease of seeing the events based on time. Back-End Description Server fetches the data from the event provider via API calls. Obtained JSON string is parsed and updated in to the database. This sequence happens as a cron job thereby updating the events dynamically on a specified time interval. The location and timestamp is set as primary key, these two parameters distinguishes an event from all other events. Recording Latitude and Longitude data is very useful, for obtaining accurate information about a location and for plotting the event in the map. MYSQL is used as the database to store all the active and scheduled events. Implementation HTML, CSS, JAVASCRIPT are three primary languages used for developing visualization. We have used PHP in apache server to process the request from the clients and dynamically update the database about current events. User supplies AJAX request to the server requesting for events which happened with in a date range. Server searches for events which are within the date range in the database. It returns user’s request with the events recorded. The server returns the events obtained to the user in a JSON format. List of POPO (Plain Old PHP Objects) objects retrieved from the database are converted to json format. JSON response is sent back to the user to visualize events. Cron jobs are scheduled to retrieve the data from API and insert in to the MYSQL database. Traffic information and event information are dynamically requested to the respective data sources. Response from the data sources are parsed from the PHP server and are updated in to the database. Below is the diagram of outline of system’s implementation. Figure 11: System Outline
  • 9.  City Traffic Event Aggregation and Visualizing Service  Page 8 Snapshots: Figure 12: User Interface Snap Shot Figure 13: SERVER (PHP) CODE
  • 10.  City Traffic Event Aggregation and Visualizing Service  Page 9 Conclusion: We have implemented the proposed architecture to store and visualize the events based on a timeline. This collection of events, can be used to predict future traffic based on a statistical analysis, alert the individuals about a link which is crowded and can be used to find root cause analysis for events. As traffic congestion is a major problem in crowded cities, this tool can be used as an effective way to visualize ongoing event information and take better decisions based on the same. Instructions to execute Back end: 1. Install XAMPP control panel tool by Apache for using MySQL and Apache Server. 2. After installation, copy the PHP Folder (containing PHP files) to <XAMPP Directory>/htdocs/ 3. Open your XAMPP Control Panel > Start Apache & MySQL Servers. 4. You can now execute the PHP files from the browser by typing http://localhost/<PHPFolderName>. Remember that this is the Folder which you had copied to htdocs before. Figure 14: Database Snapshot
  • 11.  City Traffic Event Aggregation and Visualizing Service  Page 10 Front end: 1. Copy the Client side folder to the same XAMPP directory <XAMPP Directory>/htdocs/ 2. The Client Side User Interface is now accessible in http://localhost/<ClientFolderName>. Keep in mind that this is the same folder where you had copied and pasted both your Client Side Folder and PHP Folder. The directory location should be like the above hierarchy. References 1. http://research.microsoft.com/en- us/projects/clearflow/default.aspx 2. http://www.fox10phoenix.com/story/278 42935/traffic-analytics-company-says- average-bay-area-commute-times-are- increasing 3. http://bayen.eecs.berkeley.edu/sites/defa ult/files/conferences/Blandin_Salam_Baye n_TRB12.pdf 4. http://venturebeat.com/2015/04/03/how -microsofts-using-big-data-to-predict- traffic-jams-up-to-an-hour-in-advance/ 5. Horvitz, E. J., Apacible, J., Sarin, R., & Liao, L. (2012). Prediction, expectation, and surprise: Methods, designs, and study of a deployed traffic forecasting service. arXiv preprint arXiv:1207.1352. 6. http://www.d.umn.edu/cs/thesis/lalit_noo kala_ms.pdf 7. http://www.balticroads.org/downloads/2 5BRC/25brc_d1_pakalnis_1.pdf 8. http://www.dot.state.mn.us/d3/projects/i nterregionalconnection/pdfs/final/Chapt er9.pdf 9. https://www.eventbrite.com/ 10. http://lexington.eventful.com/events 11. https://developer.here.com/rest-apis 12. http://openweathermap.org/
  • 12.  City Traffic Event Aggregation and Visualizing Service  Page 11