Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 3, 2026. It is now read-only.
/ indego.ericoc.com Public archive

Philadelphia Indego Bicycle Stations

Notifications You must be signed in to change notification settings

ericoc/indego.ericoc.com

Repository files navigation

Philadelphia Indego Bicycle Stations

About

I created this small website using Python Flask and PostgreSQL to take advantage of the Philadelphia RideIndego Bicycle Share program API.

I created this to familiarize myself and get comfortable with Python, as well as to have a fun personal project to learn from.

My original awareness of the existence of the Philadelphia Bike Share program came about because a bicycle share docking station was installed on the sidewalk across from my former apartment overnight, and I noticed it one morning.

I discovered that a GeoJSON API exists, which provides information about the bicycle and docks available at each of the stations on the OpenDataPhilly website:

I began graphing the data because I was very impressed by Dr. Randal Olson's blog, visualizing the data from each station:

API

The API end-point that I make requests to is a GeoJSON file which lists all station data:

The data is also available in GBFS format here:

Furthermore, anonymized trip data going back since the year 2005 is available on the Indego website at:

Data

Since the API end-point returns a very large response (including every station), I have this cron job which stores a complete copy of the HTTPS JSON response from the API every ten (10) minutes in this PostgreSQL table.

  • This prevents a slow page load and response time (i.e. poor performance) on every request to my website.
  • The unfortunate side effect is that I may be showing stale data, up to ten minutes old, assuming everything is working correctly.

I have been storing the data in PostgreSQL since mid-2019 and have over 202,000 rows since that time (as of mid-2023, approx. ~4 years):

indego=# select now();
 now
------------------------------
 2023年03月20日 01:23:21.64833+00
(1 row)
indego=# select min(added), max(added), count(added) from indego;
 min | max | count
-------------------------------+-------------------------------+--------
 2019年05月01日 01:00:41.994451+00 | 2023年03月20日 01:20:12.854825+00 | 202027
(1 row)
indego=#

Maps

The stations are mapped using their JSON GPS coordinates, in combination with Leaflet and OpenStreetMap.

The button to locate yourself on the map relies upon the JavaScript Geolocation API:

Charts

If you click on the blocky chart within one of the map marker pop-ups, you should see a new window graphing available bikes at that station for the past thirty (30) days.

Highcharts

The historic charts are created using a JavaScript library called Highcharts.

I was lucky enough to write a post for the Highcharts Blog at:

Questions?


Screenshots



AltStyle によって変換されたページ (->オリジナル) /