Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Create the S4 Class Trajectory
setClass("Trajectory", representation(x = "numeric", y = "numeric", time = "numeric"))
#make a new object with class Trajectory
colin <- new("Trajectory", x = 21.5, y = 21.5, time = 1200)
# create the S4 Class TrajectoryExtra which includes the Trajectory class
setClass("TrajectoryExtra", representation(speed = "numeric", direction = "numeric"), contains = "Trajectory")
colin1 <- new("Trajectory", x = c(0:10), y = c(20:30), time = c(1200:1210))
@rustyb
rustyb / IE windfarms Bufferes.md
Last active August 29, 2015 14:01
This gist contains the queries used to make the vizualisations used in my blog post on natura 2000 sites within 5-10km of a wind turbine in Ireland.

Below you will find the queries I ran in order to make the buffers around the wind turbine points and also to show the sites within these buffers.

make 10km buffers around windturbines

SELECT cartodb_id, ST_Transform(ST_Buffer(the_geom::geography,10000)::geometry, 3857) as the_geom_webmercator FROM ie_windfarms_osm

make 5km buffers around windturbines

SELECT cartodb_id, ST_Transform(ST_Buffer(the_geom::geography,5000)::geometry, 3857) as the_geom_webmercator FROM ie_windfarms_osm
@rustyb
rustyb / map.geojson
Created July 2, 2014 14:32
This a geojson file for the locations of CocaCola Bike Stations in Cork, Ireland
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rustyb
rustyb / map.geojson
Created July 2, 2014 15:13
This a geojson file for the locations of CocaCola Bike Stations in Galway, Ireland
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rustyb
rustyb / index.html
Last active August 29, 2015 14:03 — forked from anonymous/index.html
<!doctype><html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Odyssey.js Slides</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
<link rel="icon" type="image/png" href="http://cartodb.github.io/odyssey.js/sandbox/favicon.png">
@rustyb
rustyb / reg1.py
Created October 26, 2014 22:09
Regression Scripts to get R squared values
"""
Author: Colin Broderick
DESC:
Script to get linear regressions of station trips counts in NYC/London.
"""
import pandas as pd
import numpy as np
import scipy as sp
import scipy.stats
import argparse
@rustyb
rustyb / LesothoUserChanges.csv
Created March 19, 2015 16:02
Punchcard for Lesotho OSM Mappers
user mon tue wed thu fri sat sun total
4rch 0 0 0 9.0 0 0 0 9.0
AE35 11.0 4.0 1.0 3.0 1.0 1.0 1.0 22.0
Adrian Frith 0 0 1.0 0 0 1.0 0 2.0
Alecs01 0 0 0 0 0 1.0 0 1.0
Alex24223 0 1.0 0 0 0 0 0 1.0
AnyFile 1.0 0 0 0 0 0 1.0 2.0
AtomLaw 6.0 9.0 7.0 0 0 0 1.0 23.0
Aurimas Fišeras 0 2.0 1.0 0 0 1.0 0 4.0
Bacash 0 0 1.0 0 0 0 0 1.0
@rustyb
rustyb / LesothoUserChanges.csv
Last active August 29, 2015 14:17
day of the month usage
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 32 columns, instead of 10. in line 7.
"user","1 ","2 ","3 ","4 ","5 ","6 ","7 ","8 ","9 ","10 ","11 ","12 ","13 ","14 ","15 ","16 ","17 ","18 ","19 ","20 ","21 ","22 ","23 ","24 ","25 ","26 ","27 ","28 ","29 ","30 ","31 "
4rch,0.0,0.0,0.0,0.0,9.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
AE35,0.0,2.0,0.0,3.0,0.0,0.0,1.0,1.0,1.0,2.0,0.0,0.0,1.0,0.0,0.0,8.0,1.0,0.0,2.0,0.0,0.0,0.0,2.0,1.0,0.0,1.0,0.0,1.0,0.0,1.0,1.0
ATaaffe_10,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,4.0,0.0
Adrian Frith,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0
AgnesLesage,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0
Alecs01,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Alex135,0.0,0.0,0.0,47.0,0.0,0.0,0.0,0.0,0
gistup