Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View andrewxhill's full-sized avatar

Andrew W. Hill andrewxhill

View GitHub Profile
/** torque visualization */
Map {
-torque-frame-count:1024;
-torque-animation-duration:120;
-torque-time-attribute:"date_str";
-torque-aggregation-function:"avg(type_num)";
-torque-resolution:2;
-torque-data-aggregation:linear;
}
SELECT *,
CASE WHEN type='Weak Cold' THEN 1 ELSE 2 END as type_num
FROM enigma_enigma_weather_anomalies_outliers_1964_
/** bubble visualization */
#earthquakes{
marker-opacity: 0.9;
marker-line-color: #FFF;
marker-line-width: 0.5;
marker-line-opacity: 1;
marker-placement: point;
marker-multi-policy: largest;
marker-type: ellipse;
@andrewxhill
andrewxhill / index.html
Last active August 29, 2015 14:00
Tricking CartoDB into new projections
<!DOCTYPE html>
<html>
<head>
<title>Albers Equal Area | US Drought | April 2014</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
<style>
html, body, #map {
height: 700px;
width: 100%;
padding: 0;
var map = new L.Map('map_canvas', {
center: [0,0],
zoom: 2
});
cartodb.createLayer(map, 'your-vis-json')
.addTo(map)
.on('done', function(layer) {
//do stuff
var map = new L.Map('map_canvas', {
center: [0,0],
zoom: 2
});
// add a nice baselayer from Stamen
L.tileLayer('http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png', {
attribution: 'Stamen'
}).addTo(map);

Chapter 1: Introduction

part 4: CSV

1. Open CSV to look inside
2. Import CSV and compare difference
3. Show what happens when a CSV has no lat/lng
	3.1. Show how to georef
4. Show datatypes