Skip to content

KyleAnthonyShepherd/Traffic-Data-Scraping

Repository files navigation

Traffic-Data-Scraping

This code pulls traffic data from the HERE maps service.
This data has vehicle speed data, and GeoCoordinates of the roadways.
A bounding box in lat-long format can be used to get the data of interest.
Real time data must be collected, because historical data is not avaliable.

If this script is run by itself, a bounding box of bbox=[30.167808,-95.958910,29.495183,-94.911649]
is used, and the data is collected.
This script could be imported into another script, and the function
TrafficDataRealTime(bbox)
can be used on its own, if a bounding box is provided.

Data collected from here:
https://wego.here.com/traffic/explore
using the API:
https://traffic.api.here.com/traffic/6.1/flow.json
and hijacking the app code and API key from the map service
This link helped interpret the json data:
https://traffic.api.here.com/traffic/6.0/xsd/flow.xsd?app_code=K2Cpd_EKDzrZb1tz0zdpeQ&app_id=bC4fb9WQfCCZfkxspD4z

Each Output file is ~250 KB
If collected every 5 minutes, 72 MB of storage are needed every day.
26.28 GB is needed every year.

#
Code Written by:
Kyle Shepherd, at Rice University
[email protected]
Oct 24, 2018
#

About

This code pulls traffic data from the HERE maps service

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published