Skip to content

Instantly share code, notes, and snippets.

View tbuckl's full-sized avatar
Studying

Tom Buckley tbuckl

Studying
View GitHub Profile
@tbuckl
tbuckl / census_tools.md
Last active February 20, 2017 18:47
census tools

Tom's notes on travel survey

(1) Survey Recruitment

Not sure what this is! :)

(2) rMove

rmove crashed when i first opened it. had to reopen.

I turned this app on for about a day and then went on a ski trip that weekend, which made it pretty hard to use. It was entirely using up my battery when I needed it in really critical situations (long driving tip to Tahoe) and then once I got on the mountain, I had to uninstall the app in order to save my battery. Perhaps thats user error, but I wish there had been more of an "on" "off" button for the app, put right up front in a clearer place. This was sort of disappointing because I knew that my trips up and down on the ski lift were not interesting for the sake of planning transportation, but that my trip to get to Tahoe was interesting for transportation planning (I took several modes, shared cars, etc). But by the time I was ready to come back home I had already uninstalled the app and that was a bit of a barrier to get back into it, at lea

@tbuckl
tbuckl / sas_r_sql_pandas.md
Last active March 31, 2017 19:23
SAS for R Users for Pandas Users for SQL Users for SAS Users for Pandas Users for SAS Users
import geopandas as gpd
import pandas as pd
import fiona
###
#read in NHS data
###
#download data: #http://www.dot.ca.gov/hq/tsip/gis/datalibrary/zip/highway/NHS_Map21.zip
nhs = gpd.read_file("data/NHS_Map21/NHS_Map21.shp")
@tbuckl
tbuckl / d3.geo.tile.min.js
Last active May 27, 2017 11:35
Foursquare Neighborhood Estimation
d3.geo.tile=function(){function t(){var t=Math.max(Math.log(n)/Math.LN2-8,0),h=Math.round(t+e),o=Math.pow(2,t-h+8),u=[(r[0]-n/2)/o,(r[1]-n/2)/o],l=[],c=d3.range(Math.max(0,Math.floor(-u[0])),Math.max(0,Math.ceil(a[0]/o-u[0]))),M=d3.range(Math.max(0,Math.floor(-u[1])),Math.max(0,Math.ceil(a[1]/o-u[1])));return M.forEach(function(t){c.forEach(function(a){l.push([a,t,h])})}),l.translate=u,l.scale=o,l}var a=[960,500],n=256,r=[a[0]/2,a[1]/2],e=0;return t.size=function(n){return arguments.length?(a=n,t):a},t.scale=function(a){return arguments.length?(n=a,t):n},t.translate=function(a){return arguments.length?(r=a,t):r},t.zoomDelta=function(a){return arguments.length?(e=+a,t):e},t};
p1 <- "C:/projects/RTD/RegionalTransitDatabase/data/05_2017_511_GTFS"
p2 <- "C:/projects/RTD/RegionalTransitDatabase/data/05_2017_511_GTFS"
library(readr)
setwd(p2)
df1 = NULL
for (txt in dir(pattern = "_peak_bus_routes.csv$",full.names=TRUE,recursive=TRUE)){
print(txt)
df1 = rbind(df1, read_csv(txt))
}
@tbuckl
tbuckl / .block
Created June 13, 2017 06:16 — forked from mbostock/.block
Zoomable Map Tiles
license: gpl-3.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tbuckl
tbuckl / example.csv
Last active September 1, 2017 23:55
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 8.
WKT,project,project_id
"LINESTRING (-122.149204 37.4277659,-122.1468222 37.4255592,-122.145803 37.4250395,-122.1439469 37.4240341)",OBAG,129
"LINESTRING (-122.1042824 37.4293591,-122.1042824 37.4220317)",OBAG,145
"LINESTRING (-121.8660808 37.3543132,-121.830225 37.3788879)",OBAG,130
"LINESTRING (-121.8301177 37.3787514,-121.8270707 37.3808487,-121.8263197 37.3810704)",OBAG,130
"LINESTRING (-121.876359 37.2590596,-121.8818092 37.2576933,-121.8830967 37.2578641,-121.883955 37.2581032,-121.8842554 37.2583423,-121.8845558 37.258718,-121.8848133 37.2591962,-121.8851566 37.2599818,-121.8854141 37.2606307)",OBAG,121
"LINESTRING (-121.9174933 37.3106525,-121.919167 37.3107208,-121.9233298 37.3107208,-121.9305182 37.3106866,-121.9313979 37.3106696,-121.9318056 37.3107549)",OBAG,121
"LINESTRING (-121.8194318 37.2588888,-121.8192172 37.2582569,-121.8189812 37.258069,-121.8185949 37.2577445,-121.8180156 37.2572151,-121.8176723 37.2568564,-121.817565 37.2563441,-121.8176508 37.2548753,-121.8176508 37.2537651,-121.8176723
@tbuckl
tbuckl / Fishnet data dictionary.csv
Created September 6, 2017 17:51
Bay Area Greenprint Data Dictionary
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
Glossary Reference,Definition,Field name,Unit,Math to be performed,Theme
"Additional water (mm) for
irrigation - hotter and drier","Additional acre-feet per
year needed for agriculture
in a hotter and drier
climate change scenario",MIROC,Acre-feet per year,Sum,Agriculture
"Additional water (mm) for
irrigation - warmer and
wetter","Additional acre-feet per
year needed for agriculture