Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tewhalen on github.
  • I am tewhalen (https://keybase.io/tewhalen) on keybase.
  • I have a public key ASB_yeVa0_SnoErhJljBZEApNglY6v0oQQVPRzkZMR6kmAo

To claim this, I am signing this object:

@tewhalen
tewhalen / wktplotpoly.py
Created April 6, 2015 02:32
Python code that'll use matplotlib to draw polygons extracted from a GIS shapefile.
#!/usr/bin/python
"""
Uses matplotlib to plot WKT polygons in CSV format.
1. install GDAL
2. download a shapefile
3. use ogr2ogr to convert it to CSV with WKT
ogr2ogr -f CSV output.csv input.shp -lco GEOMETRY=AS_WKT
4. run getPolygons against the output csv
@tewhalen
tewhalen / chicartobin.py
Last active August 29, 2015 14:17
python matplotlib code that draws a simple cartogram of chicago community areas
#!/usr/bin/python
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.collections import PatchCollection
from string import ascii_uppercase
class CArea:
def __init__(self,n,name="",gridloc = None):