CREATE DATABASE federal lands;
\c federal lands;
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
shp2pgsql -s 4326 fedlanp020.shp | psql -h localhost -U john -d federal_lands
A modular D3.js-based geologic time scale that utilizes data from the Paleobiology Database. The repo can be found here.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
import csv | |
import sys | |
import subprocess | |
with open(sys.argv[1], 'rb') as csvfile: | |
reader = csv.reader(csvfile) | |
header_row = reader.next() | |
cmd1 = "psql -U you dbname -c 'CREATE TABLE " + sys.argv[2] + " (" | |
for idx, column in enumerate(header_row): |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-icons.min.css" rel="stylesheet"/> | |
</head> | |
<body> | |
<div style="padding:20px;"> | |
<p>Standard Bootstrap typeahead</p><input placeholder='Type a country' type='text' size='22' name='countries' data-provide='typeahead'/> |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
background: #fcfcfa; | |
height: 500px; | |
position: relative; | |
width: 960px; | |
} | |
#projection-menu { |
import urllib2 | |
import sys, os | |
from StringIO import StringIO | |
from zipfile import ZipFile | |
import psycopg2 | |
import subprocess | |
# Connect to Postgres | |
pg_conn = psycopg2.connect(dbname="database", user="you", host="localhost", port=5432) | |
pg_cur = pg_conn.cursor() |
Based on http://codepen.io/anon/pen/umArH, which is based on http://bost.ocks.org/mike/fisheye/
Inspired by http://www.nytimes.com/newsgraphics/2013/09/13/fashion-week-editors-picks/