jwszol-classes / isp-2020-ZekJakGynDam

Visualization of airplanes flying above Poland with use of Amazon AWS technologies.
1 stars 0 forks source link
airplanes aws requests visualizations

Airplanes

Project with use of AWS that is used to visualize airplanes that are located in Poland. This branch is used as simplified version of entire project.

Technologies used and data flow

diagram

AWS EC2 instance

AWS EC2 instance is used for running continuous program that send request to Opensky-Api in order to get data such as:

about all airplanes that are currently above geographic bounding box (49.0273953314, 54.8515359564, 14.0745211117, 24.0299857927) (min_latitude, max_latitude, min_longitude, max_latitude) that is based on the extreme geographical points of Poland. These data (together with timestamp of performed request) are then send to Kinesis data stream.

Kinesis data stream

Kinesis data stream gets data about airplanes and distribute them to different shards, that provide them into AWS Lambda.

AWS Lambda

Because data received from Opensky-Api contain data about all airplanes in specified geographic bounding box, then these contains data about airplanes above Poland, and some of neighboring countries. AWS Lambda is then used in order to remove data about airplanes that aren't above Poland. On the end of AWS Lambda function, the most important data are saved into AWS DynamoDB tables.

AWS DynamoDB

AWS DynamoDB is used as storage for historical and last data of airplanes above Poland in two tables.

Each table contain following columns:

Local Machine

Local Machine (that is personal computer) is used to repeatedly reading data from DynamoDB table with last airplanes data and visualize them with use of Mapbox.

Exemplary view on airplanes above Poland

diagram

Setup

Create virtual environment:

python -m virtualenv venv
cd venv/Scripts/activate

Setup OpenSky-API

Create account on OpenSky-api: https://opensky-network.org/index.php?option=com_users&view=registration

Setup Mapbox

Create account on Mapbox: https://www.mapbox.com/maps/

EC2

Generate key pairs

Launch instance

Connect with instance

Instance setup - configure git

Instance setup - prepeare repository

Instance setup - configure AWS

Instance setup - create image

Prepare AWS Services

Kinesis, S3, Lambda, DynamoDB

Adding Trigger to Lambda function

Local machine configuration

Linux Ubuntu

Configuration is similar to the one described in EC2 section

Windows

Credentials

Prepare credentials.json file in main project directory by duplicate credentials_default.json and changing its name (don't add this file to repository!). Fill places with your registrations, access tokens data, aws vocareum cookies data etc.

Run

On EC2 instance run to read airplanes data:

python kinesis\producer.py

On local machine run to visualization airplanes:

python visualisation_animation_plotly.py

Open following url link in browser:

http://127.0.0.1:8050/