rafapereirabr / gtfs_to_igraph

R script to convert a GTFS feed into an igraph object for network analysis in R
19 stars 8 forks source link

gtfs_to_igraph

This repo presents a function convert a GTFS feed (or a list of GTFS feeds) into an igraph object for network analysis in R.

Workflow

The workflow of the function is as follows:

Input

This function needs three inputs:

obs. This function was tested using the GTFS of Las Vegas, USA, downloaded on Oct. 2017. This file is made available in the GitHub repo but it can also be downloaded by running this line in R:

download.file(url="http://rtcws.rtcsnv.com/g/google_transit.zip", destfile = "google_transit.zip")

How to use the function

# set working Directory
  setwd("R:/Dropbox/github/gtfs_to_igraph")

# get a list of GTFS.zip files
  my_gtfs_feeds <- list.files(path = ".", pattern =".zip", full.names = T)

# load function
  source("gtfs_to_igraph.R")

# run function
  g <- gtfs_to_igraph(list_gtfs = my_gtfs_feeds,  dist_threshold =30 , save_muxviz =T)

Next steps: looking for collaborators :)

Related projects which I still need to learn from: