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
Created August 28, 2015 21:32
map for harun
<!DOCTYPE html>
<html>
<head>
<title>
CartoDB
</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
@andy-esch
andy-esch / CartoDBjs-lesson1.html
Last active August 29, 2015 14:07
Template for Lesson 1, CartoDB.js from the ground up
<!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
Last active August 29, 2015 14:07
slider example using jquery's ui
<!doctype html>
<html lang="en">
<!-- pulled some code from http://jqueryui.com/slider/#rangemin -->
<head>
<meta charset="utf-8">
<title>CartoDB.js Opacity Slider</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
@andy-esch
andy-esch / CrisisMappers.md
Last active August 29, 2015 14:08
Draft Crisis Mappers Outline

CrisisMapper Workshop Outline (~30 minutes)

Nov. 6, 2014

  1. Introduce myself
  2. Goals for the day
    • Brief Intro to CartoDB
    • Set you up with accounts: https://cartodb.com/signup?plan=academy
    • Make maps quickly once data source is identified
    • Easily combine multiple data sources into single visualization
  • Publish maps to the web, share in social media
@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:09
CartoDB.js CartoCSS Example
<!DOCTYPE html>
<html>
<head>
<title>Lesson 2 | 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" />
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />
<link rel="stylesheet" href="http://academy.cartodb.com/css/cdbui.css">
--PART 2
-- a.
SELECT * FROM tornados
SELECT cartodb_id FROM tornados
-- b.
SELECT * FROM tornados LIMIT 1
SELECT * FROM tornados LIMIT 1 OFFSET 1
SELECT * FROM tornados ORDER BY damage DESC LIMIT 10
-- c.
SELECT * FROM tornados WHERE cartodb_id < 30
@andy-esch
andy-esch / GreatCircleArcs.md
Last active August 29, 2015 14:10
Great Circle Arcs

First you need to paste this into the SQL text editor:

INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 953027, 'esri', 53027, '+proj=eqdc +lat_0=0 +lon_0=0 +lat_1=60 +lat_2=60 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs ', 'PROJCS["Sphere_Equidistant_Conic",GEOGCS["GCS_Sphere",DATUM["Not_specified_based_on_Authalic_Sphere",SPHEROID["Sphere",6371000,0]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Equidistant_Conic"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",0],PARAMETER["Standard_Parallel_1",60],PARAMETER["Standard_Parallel_2",60],PARAMETER["Latitude_Of_Origin",0],UNIT["Meter",1],AUTHORITY["EPSG","53027"]]');

Just delete everything in there (SELECT * FROM table_name), and replace it with what's above. It tells the PostGIS to do something that projects your lines into the different projection. This allows you to do this in your account from now on. When you hit Apply Query, it sh

@andy-esch
andy-esch / index.html
Last active August 29, 2015 14:10
End product for third CartoDB.js lesson (SQL and CartoCSS methods)
<!DOCTYPE html>
<html>
<head>
<title>
Lesson 3 | 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" />
@andy-esch
andy-esch / cartodb.js-deep-dive.md
Last active August 29, 2015 14:10
CartoDB14 Outline for CartoDB.js
@andy-esch
andy-esch / partners-template.html
Last active August 29, 2015 14:11
Template for partners workshop
<!DOCTYPE html>
<html>
<head>
<title>Lesson 2 | 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" />
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" />