- Tweet any questions to me and I'll do my best to answer them: @MrEPhysics
- Leave questions in the webinar chat
Find this doucment at: http://bit.ly/cartodb-future-gis
// gmaps js api v2 polygon overlays -> geojson | |
overlayToGeoJSON = function(o){ | |
var feature={type:'Feature', geometry:{ type:'Polygon', coordinates:[[]]}}; | |
for (var i=0; i < o.latlngs.length; i++){ | |
feature.geometry.coordinates[0].push([o.latlngs[i].lng + o.reflng, o.latlngs[i].lat + o.reflat]) | |
} | |
feature.properties = {hint:o.hint, html: o.infohtml} | |
return feature; | |
} | |
var results={type: "FeatureCollection", features: []}; |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
initdb /usr/local/var/postgres9.4 -E utf8 | |
pg_upgrade -v \ | |
-d /usr/local/var/postgres \ | |
-D /usr/local/var/postgres9.4 \ | |
-b /usr/local/Cellar/postgresql/9.3.5_1/bin/ \ | |
-B /usr/local/Cellar/postgresql/9.4.1/bin/ | |
mv /usr/local/var/postgres /usr/local/var/postgres9.3 | |
mv /usr/local/var/postgres9.4 /usr/local/var/postgres | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist |
{ | |
"Arial Unicode MS": [ | |
"Arial Unicode MS Regular", | |
"Arial Unicode MS Bold" | |
], | |
"Brokenscript OT": [ | |
"Brokenscript OT Bold", | |
"Brokenscript OT Cond Bold" | |
], | |
"Brokenscript Rough OT": [ |
# Requires ModestMaps to be installed | |
# Don't do this unless you have a very good reason, and a MapBox account, | |
# and you replace the 'examples' tileset with a tileset in your account. | |
import ModestMaps as MM | |
from ModestMaps.Geo import MercatorProjection, deriveTransformation | |
from ModestMaps.Providers import IMapProvider | |
from math import pi | |
class MapBox(IMapProvider): |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
<style> | |
html, body { | |
background: #ffffff; | |
font-family: Helvetica, Arial, Tahoma, sans-serif; | |
margin: 0; |
Find this doucment at: http://bit.ly/cartodb-future-gis
These commands are all run within the psql
command line tool.
Create table for tax year 2013 data
CREATE TABLE tx_2013 (
Acct_Num varchar(9),
Address text,
Unit text,
Homestd_Ex text,
Prop_Cat text,
-- Census tract population is column dp0010001 | |
WITH op AS | |
(SELECT the_geom, | |
cartodb_id, | |
dp0010001, | |
Row_number() OVER ( | |
ORDER BY Cdb_latlng(/* Starting latitude */, /* Starting longitude */) <-> the_geom) AS row_number | |
FROM /* Table name */ LIMIT /* Max census tracts queryable */), | |
sm AS |
import base64 as b64 | |
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
from ipywidgets import interact, interactive, fixed | |
from IPython.display import Image, display | |
import ipywidgets as widgets | |
from itertools import tee, izip | |
WINDOW_SIZE = 41 # size of window to use when computing averages. Endpoint images outside |
###Creating static data visualizations with D3.js and Node.js###
See the accompanying blog post for more details on how to create static data viz using D3.js and Node.js
Re-creates Mike Bostock's area choropleth example for Node.js. Allows for output/creation of a non-interactive SVG via the command line.
Requires Node.js and npm. You will also need D3.js for Node.js, installed via,
npm install d3