Demo of CitySDK/OpenTripPlanner Analyst combination
CSS JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_data
css
fonts
images
js
.gitignore
README.md
_config.yml
index.html
schools.geo.json

README.md

Reachability of schools in Amsterdam

Jekyll + Leaflet + Turf.js site, which computes and shows reachability of schools in Amsterdam using OpenTripPlanner Analyst. School data is also accessible via Waag Society's CitySDK LD API endpoint.

The site can be used to answer the following question:

Which schools in Amsterdam are within 20 minutes of bike and public transport travel from my home?

Screenshot

Serve site using Jekyll or GitHub pages

You can fork this repository, the website will be automatically hosted by GitHub Pages on http://username.github.io/schools. Or, clone/download this repository, and serve the site using Jekyll:

jekyll serve --baseurl ''

OpenTripPlanner

This project requires that you have a server running with the latest version of OpenTripPlanner.

It's eastiest to put OTP, and its data and graphs under /var/otp:

cd /var
sudo mkdir otp
sudo chown <user>:<group> otp
cd otp
mkdir graphs
cd graphs
mkdir amsterdam

Download the latest OpenTripPlanner JAR to /var/otp:

wget http://dev.opentripplanner.org/jars/otp-0.14.0.jar -P /var/otp

OpenTripPlanner needs OpenStreetMap road network data and GTFS public transport schedules to do its routing and analysis.

Note: the bigger the GTFS and OSM files are, the more memory OpenTripPlanner needs. Please start with city-size source files! (Or buy lots of memory.)

This website needs just data for the Amsterdam metropolitan area:

Type File Source
OpenStreetMap amsterdam_netherlands.osm.pbf OSM Metro Extracts
GTFS gtfs-iffns-latest.zip (NS) OVapi
GTFS gtfs-kv1connexxion-latest.zip (Connexxion) OVapi
GTFS gtfs-kv1ebs-latest.zip (EBS) OVapi
GTFS gtfs-kv1gvb-latest.zip (GVB) OVapi

You can download all the files needed for this project by running:

cd /var/otp/graphs/amsterdam
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/amsterdam_netherlands.osm.pbf
wget http://gtfs.ovapi.nl/ns/gtfs-iffns-latest.zip
wget http://gtfs.ovapi.nl/connexxion/gtfs-kv1connexxion-latest.zip
wget http://gtfs.ovapi.nl/ebs/gtfs-kv1ebs-latest.zip
wget http://gtfs.ovapi.nl/gvb/gtfs-kv1gvb-latest.zip

Error in gtfs-iffns-latest.zip

In some versions of the NS GTFS file (gtfs-iffns-latest.zip), the required field agency_url is missing in agency.txt:

751,U-OV,,Europe/Amsterdam,nl
951,Eurostar,,Europe/Amsterdam,nl

To fix this, just open agency.txt and add a (fake) URL:

751,U-OV,http://www.example.com/,Europe/Amsterdam,nl
951,Eurostar,http://www.example.com/,Europe/Amsterdam,nl

Build OTP graph

Build the OpenTripPlanner graph:

java -Xmx4G -jar /var/otp/otp-0.14.0.jar --build /var/otp/graphs/amsterdam

Run OpenTripPlanner server:

java -Xmx4G -jar /var/otp/otp-0.14.0.jar --router amsterdam --server --analyst --pointSets ./pointsets

Afterwards, OpenTripPlanner should be available on http://localhost:8080/index.html.

The --pointSet ./otp/pointsets argument loads the Amsterdam schools pointset into OpenTripPlanner Analyst. You can see if OTP loads the file correctly by checking the URL http://localhost:8080/otp/pointsets/schools.geo.

Configuration

You can configure this project by editing the YAML files in the _data directory. otpa.yml contains the OpenTripPlanner endpoint configuration, which is by default expected to run on localhost:8080.