This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Estimated travel time does NOT include waiting time | |
library(httr) | |
library(stringr) | |
getTravelTime <- function(start_code, stop_code){ | |
params <- list( | |
mrtcode_start = start_code, | |
mrtcode_end = stop_code, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Haversine distance between ODPostalcodes" | |
output: | |
html_notebook: default | |
html_document: default | |
--- | |
```{r} | |
require("dplyr") | |
postalcodes <- read.csv(file.choose(), stringsAsFactors = FALSE, header=TRUE) | |
head(postalcodes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on the solution described here: http://geospatialpython.com/2011/11/generating-shapefile-shx-files.html | |
# Requires pyshp (pip install pyshp) | |
# Run script from shapefile folder | |
# Build a new shx index file | |
import fnmatch | |
import os | |
import shapefile | |
# List all the shapefiles |