Skip to content

Instantly share code, notes, and snippets.

View andy-esch's full-sized avatar
🌳

Andy Eschbacher andy-esch

🌳
View GitHub Profile
@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:11
Using SQL API to create graph
<!doctype html>
<html>
<head>
<title>Car accidents per person by neighborhood</title>
<script src="http://www.chartjs.org/assets/Chart.js"></script>
<meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>
<style>
canvas {
}
@andy-esch
andy-esch / alaska.md
Last active August 29, 2015 14:13
Alaska Press Club Workshop

CartoDB Workshop -- Alaska Press Club

Andy Eschbacher, Map Scientist, CartoDB

January 8, 2015

Find this document here: http://bit.ly/1yGlQvV

Outline

  1. Introduction to CartoDB (30 minutes) -- 1:00 - 1:30 p.m.
@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:13
Named Map example using Leaflet
<!DOCTYPE html>
<html>
<head>
<title>Lesson 1 | CartoDB.js | CartoDB</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" />
<!-- Map takes up full browser window -->
<style>
@andy-esch
andy-esch / index.html
Created January 9, 2015 23:06
Named map with createLayer
<!DOCTYPE html>
<html>
<head>
<title>Named maps with createLayer | CartoDB</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" />
<!-- Map takes up full browser window -->
<style>
@andy-esch
andy-esch / config.json
Last active August 29, 2015 14:13
Named map with interactivity and config file used to create it
{
"version": "0.0.1",
"name": "namedmap_ex_test_interactive",
"auth": {
"method": "open"
},
"layergroup": {
"layers": [{
"type": "mapnik",
"options": {
@andy-esch
andy-esch / checkerboard.sql
Last active August 29, 2015 14:14
make a checkerboard from an appropriately-sized table
-- By using a table with 4^zoom rows, the following sql statement produces a checkboard
-- The following config works for making a checkerboard with zoom = 3 (4^3 = 64 rows)
WITH
vars AS (SELECT 3 AS zoom)
SELECT
(8 * ss.c1 + ss.c2 = ss.cartodb_id) as tf,
ss.c1,
ss.c2,
ss.cartodb_id as cartodb_id,
@andy-esch
andy-esch / sipa.md
Last active August 29, 2015 14:14
Columbia SIPA workshop 3/24/2015

Spatial Data Analysis

Andy Eschbacher, Map Scientist, CartoDB

Workshop, March 24th, 2015, School of International and Policy Affairs, Columbia University

Find this document here: http://bit.ly/cdb-sipa (Source code)

Nepal flag from Wikipedia

@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:14
charts on click events in dashboard
<!DOCTYPE html>
<html>
<head>
<title>Custom infowindow example | CartoDB.js</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 {
height: 100%;
@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:15
Use bounding box to calculate values to populate a chart
<!DOCTYPE html>
<html>
<head>
<title>Custom infowindow example | CartoDB.js</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 {
height: 100%;
@andy-esch
andy-esch / osgeo.md
Last active August 29, 2015 14:15
OSGEO: PostGIS in CartoDB