Skip to content

erwanlecarpentier/traffic_data_fetcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traffic Data Fetcher

Python script to fetch data from the Google Maps Distance Matrix API. The API is provided here and requires a Google API key that can be found here.

Use

There are two ways of using the script, each corresponding to a mode set in the parameters file 'parameters.py'.

  1. By creating a complete duration matrix. (mode = 0)
    In this case, you should provide the structure of the graph with the 'graph_structure.csv' provided as an example. The output will be the resulting duration matrix, saved at the location set in the parameters.

  2. By filling a duration matrix. (mode = 1)
    In this case, you should provide the path to the uncomplete duration matrix in the parameters file. The output will be the completed duration matrix, saved at the location set in the parameters.

In each cases, other parameters such as the considered period of time and the time step width are set into the parameters file.

Duration matrix

The resulting duration matrix has the following structure:

Starting location Goal location t0 ... tM
start0 goal0 duration0,0 ... duration0,M
... ... ... ... ...
startN goalN durationN,0 ... durationN,M

Whith the following notations:

  • (start0, ..., startN) are the starting locations of the edges;
  • (goal0, ..., goalN) are the goal locations of the edges;
  • (t0, ..., tM) are the time steps of departure time (s);
  • (durationi,j) are the computed durations.

About

Traffic data fetcher using the Google Maps Distance Matrix API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages