Hands-on Tutorials

Using Python and Unfolded to visualize RTD’s real-time bus data feeds

The Regional Transportation District, more commonly referred to as RTD, is the regional agency operating public transit services in Denver. RTD has an open data platform that publishes:

  • Schedule data, including the full schedule and route configuration
  • Real-time data for RTD bus services, including information about arrival/departure predictions and vehicles locations as GTFS real-time feeds
Final Visualization using Unfolded (Image by Abdullah Kurkcu)

We will use the real-time data feed to first store some data and then use freshly released Unfolded studio to visualize bus movements. It is possible to use Uber’s Kepler.gl to achieve the same result.

While looking for examples about how to download GTFS real-time…


An Empirical Analysis of Snowfall Events on Macroscopic Traffic Variables

I was recently working on collecting traffic data for a state highway going through mountains and I decided to investigate the effects of snowfall on traffic operations. While looking for similar studies, I found this research study from China looking at the impact of rain on traffic.

Photo by Brett Sayles from Pexels

I thought I would follow a similar approach to understand snow impacts and create a simplified macroscopic fundamental diagram (MFD) to summarize traffic operations. To achieve this objective, I collected traffic data for state highway (SH) 285 and climate data from a nearby weather station. The gathered data are summarized below:

  • ATR Traffic…


Analyzing Bike Ridership Trends

If you have read my last story, I promised that I would take a look at the change of bicycle counts before and after the pandemic. This story will talk about visualizing the change in bicycle counts and comment on the results.

I used the codes I developed the last time to download data from https://dtdapps.coloradodot.info/bikeped. More information on how to build those can be found in my previous story.

The CDOT website allows you to find stations with continuous counts. I found nine stations that have bicycle counts in 2020. However, some of them had…


Hello everyone,

It’s been a while since the last time I published an article. I had a little bit of spare time in between jobs. So, I decided to write a new one that explains how to download publicly available bike data from the city of Denver and visualize it using KeplerGl library for Python.

By the way, I started working as a Lead Traffic Modeler at Ulteig. Please check out the company and if you are in the transportation business, hit me up!

This article has actually become the first part of a series. The reason I started doing…


NYC taxi data visualization

Source: https://eng.uber.com/h3/

H3 is a geospatial indexing system developed and open sourced by Uber. It provides functions for converting latitude/longitude coordinates into H3 geospatial hexagonal tiles.

It is entirely written in C but there are bindings available for other languages including Python, R, and Ruby.

As a transportation engineer, we do use zones and zoning in our analyses a lot. However, manually drawn partitions of maps have limitations, such as the center of a zone not representing the center of the data points, unequal number of neighbors and unequal distances to neighbors, and some other undesirable boundary effects.

There are many good…


Hello everyone,

We realized that there is no application that reports NBA results of the day on Slack during one of our meaningless conversations about sports. Since it was the long weekend, I started to look for potential resources I can utilize to bring the scores to our slack channel.

Reading Matt Makai’s post about how to build a slack bot with python, I was able to initialize the first version of the bot following the steps explained here:

https://www.fullstackpython.com/blog/build-first-slack-bot-python.html

The next step was to find a way to reliable get live scores. …


While looking for libraries to create animated plots, I found this gem. I thought this was new but it looks like it s been there for a while. Tweenr library makes your gganimate transitions smoother by including more frames in between. I will show an example below.

Since I am a transportation engineer, I wanted to download some traffic data. Therefore, I used Caltrans PEMS tool. I downloaded traffic data for 3 days including Feb 5th, 7th and 9th — Monday, Wednesday, and Friday respectively. I wanted to show my students the change in speed for 3 different days. …


To use deck.gl you need

  • Node.js
  • webpack
  • Mapbox Access Key

First, we need Node.js installation. I am using a Windows machine, thus, I used the installation file provided below.

However, I downloaded this months ago. I needed to update my npm by running a PowerShell as an Administrator on Windows and run following commands. You may skip it if you freshly installed npm.

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade

The first one is pretty important. After updating my npm, I tried to run

npm install --save deck.gl luma.gl

as it stated on Uber’s github. However, I…


Let’s first load the library we are going to use in R.

library("rgl")

This is a Markdown document. If you are interested about how to do similar HTML pages, please visit: http://rmarkdown.rstudio.com

We stored MTA Bustime Data using their API for a day for all the buses and converted it into pings.csv

# Read the input into a dataframe df <- read.csv("../Data/pings.csv", head=TRUE, skip=1) # Check the class of the RecordedAtTime column class(df$RecordedAtTime)## [1] "factor"# convert the class of the RecordedAtTime column 
df$RecordedAtTime <- as.POSIXlt(df$RecordedAtTime)
# Extract hour from the column head(df$RecordedAtTime$hour)## [1] 7 8 7 8…

Install iw

Enable Camera

sudo nano /etc/machine-info
PRETTY_HOSTNAME=device-name
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install sqlite3
sudo apt-get install python-pcapy
sudo apt-get install libssl-dev # you have to install this
sudo apt-get install sqlite3 build-essential libssl-dev libnl-3-dev libnl-genl-3-dev install python-pcapy PyOBEX PyBluez python-bluetooth ethtool
wget http://download.aircrack-ng.org/aircrack-ng-1.2-rc4.tar.gz
tar -zxvf aircrack-ng-1.2-rc4.tar.gz
cd aircrack-ng-1.2-rc4
sudo make install
sudo airmon-ng start wlan0
sudo raspi-config
sudo apt-get install iw
fix the date
sudo dpkg-reconfigure tzdata
sudo crontab -e@reboot sh /home/pi/wifi/launcher.sh >/home/pi/wifi/logs/cronlog 2>&1Dropbox Uploader
git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
cd Dropbox-Uploader
./dropbox_uploader.sh
Send Bluetooth Message sudo apt-get install python-setuptools python-dev build-essential
sudo pip install PyOBEX
sudo…

Abdullah Kurkcu

Lead Traffic Modeler @Ulteig

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store