Highway Health will use data from APIs supplied by the following company's APIs: OpenWeatherMaps and Here Real-Time Traffic. The data gathered from those APIs will be utilitized to create a map visualization via Deck.gl. This project supports an end user that requires knowledge of the status of roads, such as shipping and trucking companies.
Python 3.10
MariaDB SQL Database or Any other SQL Server Database of your choice
PIP [Optional, to install dependencies]
Generate an OpenWeatherMaps Current Weather Data API key: Create an account at https://openweathermap.org/
and select the "Get API key" button at https://openweathermap.org/price
.
Generate a HERE Traffic API v7 API key: Create an account at https://account.here.com/sign-up
, create a project at https://platform.here.com/management/projects
, and create an app at https://platform.here.com/admin/apps
.
- Download Project.
- Run
pip install -r requirements.txt
to install the required dependencies. - To run the server, use
python flaskr/__init__.py
- Visit the server on
http://localhost:5000
or127.0.0.1:5000
[url] / - homepage (displays traffic and weather information as plot points)
[url] / graph - 3d hexagonal bar graph (displays traffic information as elevated bars)
[url] / heatmap - heatmap (displays traffic information on a heatmap)
- Download Project.
- Run
npm install <package_name>
to install the following dependencies:- [email protected] --save-dev
- deck.gl/core
- deck.gl/layers
- Before running
initCreateDB.py
andpython datasetManip.py
, change MYSQL server variables [host, user, password],- Edit the script using Text Editor of your choice
-
Update
project_config.ini
file with appropriate API keys, tokens, and IDs. -
Update
datasetManip.py
FILEPATH infile_path = 'FILEPATH\TxDOT_Roadway_Inventory_RICHARDSON.geojson'
with your local filepath. -
Update
openWeatherAPIcalls.py
FILEPATH insys.path.insert(0, r'FILEPATH\database')
with your local filepath. -
Run
python database/initCreateDB.py
to create the local database and table(s). -
Run
python database/datasetManip.py
to insert all .geojson data into local database. -
Run
python weather/openWeatherAPIcalls.py
to start daemon for hourly API calls to OpenWeatherMaps and saving historal data to local database. -
Run
python hereTraffic/here_traffic_api.py
to start daemon for hourly API calls to HERE traffic data and saving historical data to local .csv file.
--- Functional Requirements ---
- API access
- OpenWeatherMaps for weather + geodata.
- HERE for real-time traffic data and map features.
- Deck.gl
- Webpack.
- One of the base maps.
- Layers for the map.
- Website application to be written in Javascript with CSS for style.
- Data processing
- Via regular API calls (hourly) from two data sources (OpenWeatherMaps, HERE) a larger data source will be compiled and then manipulated to identify/confirm traffic or weather related concerns that can cause hazardous highways in the Dallas/Richardson, TX area.
- Data manipulation to be completed via Python.
- Workspace that allows development in Python, Javascript, CSS (any others to be determined).
- Access to the Highway Health Github Repository required for version control.
--- External Interface Requirements ---
- For the user:
- Hardware: Access to computer, internet
- Software: Access to an internet browser
- For the developer/owner:
- APIs referenced in point 1 in Functional Requirements will need to be able to communicate with the code used to implement our Deck.gl map application.
--- Nonfunctional Requirements ---
- Performance
- API calls can be made once per hour with minimal impact.
- Quality
- Need to have: have data from all sources marked on the map based on our internal requirements within a certain geographic range. Essentially: Place a dot on the map.
- Nice to have: Add functionality to "a dot on the map" to have things like: different colored dots based on severity, tooltips showing the issue (flooding, traffic, so on), etc.
--- Data Manipulation and Catagorization ---
- Once tested what we can use from data pulled via APIs can go back to this and determine what to include/exclude from map and how we want to catagorize what we do put on the map.