Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
// 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: []};
@jeremyjbowers
jeremyjbowers / fix_ur_postgres.sh
Created February 11, 2015 16:32
A quickie shell script for fixing your Postgres installation on a Mac when migrating from 9.3.5 to 9.4.1 via homebrew.
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": [
@tmcw
tmcw / modestmaps-tiling.py
Created December 4, 2012 00:05
ModestMaps-py Tiling with MapBox
# 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):
@erikhazzard
erikhazzard / index.html
Last active November 13, 2015 06:42
Fog of War SVG Filter Mask Example
<!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;
@andy-esch
andy-esch / readme.md
Last active November 18, 2015 21:56
Webinar: Celebrating all things GIS -- November 18, 2015

Future of GIS

Andy Eschbacher, Map Scientist, CartoDB

Questions

  1. Tweet any questions to me and I'll do my best to answer them: @MrEPhysics
  2. Leave questions in the webinar chat

Find this doucment at: http://bit.ly/cartodb-future-gis

@caseycesari
caseycesari / avi-map-sql.md
Last active December 14, 2015 14:29
The SQL for creating a parcel layer simliar to the one that powers http://apps.axisphilly.org/avi-map

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
@pykerl
pykerl / README.md
Last active June 7, 2016 15:41
Creating static data visualizations with D3 & Node