Skip to content

Instantly share code, notes, and snippets.

View mattmakesmaps's full-sized avatar

Matthew Kenny mattmakesmaps

View GitHub Profile
@mattmakesmaps
mattmakesmaps / gist:8050735
Created December 20, 2013 05:25
An example of the applied duck-type interface within common python built-in functions. The len() built-in will successfully execute on any input that meets its interface criteria: a __len__() method that returns an integer.
Python 2.7.6 (default, Dec 7 2013, 21:06:22)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyClass(object):
... def __init__(self):
... self.foo = "foo"
...
>>> m = MyClass()
>>> m.foo
'foo'

Fun with vector maps

Quick TopoJSON vector tile demo map, derived from an earlier GeoJSON demo. Original README follows.

A goofy slippy map of various vector tile data sources. With some fun colours, greetz to Aaron and Mike and Mike and the whole Prettymaps crew.

Sacramento, CA

"osm-processed_p1": { // Layer Name
// Sets ACCESS-CONTROL-ALLOW-ORIGIN header to "*"
"allowed origin": "*",
"provider": {
"class": "TileStache.Goodies.VecTiles:Provider",
// PostGIS Connection Info
"kwargs": {
"dbinfo": {
"host": "localhost",
"user": "matt",
@mattmakesmaps
mattmakesmaps / s00_9_147_196.topojson
Last active December 25, 2015 01:39
TileStache VecTiles provider test. rendering TMS address 9,147,196. "simplify" parameter values of 1,2,10,100. TODO: Update GIST to include SQL statement passed into PostGIS for WKB extraction.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattmakesmaps
mattmakesmaps / 9_147_196_1.topojson
Created October 9, 2013 06:04
TileStache VecTiles provider test. rendering TMS address 9,147,196. "simplify" parameter values of 1,2,10,100.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattmakesmaps
mattmakesmaps / numpyerror.py
Created July 11, 2013 03:57
numpy traceback error with ArcGIS Desktop 10.1
>>> import arcpy
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\__init__.py", line 24, in <module>
from arcpy.toolbox import *
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\toolbox.py", line 342, in <module>
from management import Graph, GraphTemplate
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 22, in <module>
import _management

MVA Application - Divergent Files Review

Overview

This document is designed to present a basic overview of files contained within the larger WDNR Marine Spatial Planning (MSP) codebase, that were modified for the purposes of the WDNR Marine Vegetation Atlas (MVA). Additionally, newly created files, specific to the MVA, will be reviewed.

@mattmakesmaps
mattmakesmaps / README.md
Last active December 18, 2015 16:59
Dynamically processed stream gauge data.

This visualization depicts a dynamic representation of stream flow in Cubic Feet per Second, "CFS", for three stream gauge stations in Washington State. A locally run python script is executed via Cron-job every hour, on the hour. The script is designed to query data from the USGS Instantaneous Values REST Web Service and format it for use in d3.

These data are then committed to github via a machine user account on the local machine. This visualization, stored as a gist, points to this periodically updated dataset.

Why do this? I wanted to learn the workflow for processing remote data on a local machine, with the end point of exposing it automatically via github. You could easily perform the data processing for this visualization using pure JS, but there are other use cases. What if, for example, you w

@mattmakesmaps
mattmakesmaps / README.md
Last active December 18, 2015 10:39 — forked from mbostock/.block