Skip to content

Instantly share code, notes, and snippets.

View nickpeihl's full-sized avatar

Nick Peihl nickpeihl

View GitHub Profile
@nickpeihl
nickpeihl / geoservices-js
Last active August 29, 2015 13:58
Error using simplest example from geoservices-js docs.
O:\Workspace\Nick\Public Works\Citizen Engagement\nodejs>node server.js
O:\Workspace\Nick\Public Works\Citizen Engagement\nodejs\node_modules\geoservice
s\lib\featureservice.js:61
this.get();
^
TypeError: Object #<Geoservices> has no method 'get'
at Geoservices.FeatureService (O:\Workspace\Nick\Public Works\Citizen Engage
ment\nodejs\node_modules\geoservices\lib\featureservice.js:61:8)
at Object.<anonymous> (O:\Workspace\Nick\Public Works\Citizen Engagement\nod
@nickpeihl
nickpeihl / contributions_totals.json
Last active August 29, 2015 14:05
San Juan County Political Contributions Visualized
{
"name": "2013 Contribution Totals",
"children" : [
{
"rID" : "0194b2d1d3db739c1ef2144a7754f890",
"name" : "WA ST NATL ORG FOR WOMEN PAC",
"year" : 2013,
"amount" : 10
},
{
@nickpeihl
nickpeihl / expenditure-tree.html
Last active August 29, 2015 14:06
Public Works Budget Bubbles
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<style>
.node circle {
fill: rgba(220,80,255,1);
stroke: rgba(147,2,183,1);
stroke-width: 3px;
}
@nickpeihl
nickpeihl / index.html
Last active August 29, 2015 14:07 — forked from d3noob/.block
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Collapsible Tree Example</title>
<style>
.node circle {
@nickpeihl
nickpeihl / README.md
Last active August 29, 2015 14:10 — forked from mbostock/.block

A demo of TopoJSON on a U.S. counties shapefile from the U.S. census bureau. The same TopoJSON file can also be used to show states.

@nickpeihl
nickpeihl / testTiff.js
Created August 31, 2015 20:48
GeoTIFF Test for Mapnik-Omnivore
var fs = require('fs');
fs.open('CW.tif', 'r', function(err, fd) {
var buf = new Buffer(100);
fs.read(fd, buf, 0, 100, null, function(err, bytesRead, buffer) {
var head = buffer.slice(0, 100).toString();
if((head.slice(0,2).toString() === 'II' || head.slice(0,2).toString() == 'MM') && ((buffer[2] === 42) || buffer[3] === 42)) {
console.log('file matches GeoTiff');
} else {
console.log('head-slice is ', head.slice(0,2).toString(), ' and buffer[2] equals ', buffer[2], ' and buffer[3] equals ', buffer[3]);
}
@nickpeihl
nickpeihl / naip.mapurl
Created October 20, 2015 21:54
NAIP mapurl for Geopaparazzi
url=http://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryOnly/MapServer/tile/ZZZ/YYY/XXX
minzoom=8
maxzoom=17
type=google
format=jpg
bounds=-122.330832,47.640989,-122.283883,47.662931
defaultzoom=15
mbtiles=defaulttiles/_naip-tile.mbtiles
description=USGS Ortho and Satellite Imagery
@nickpeihl
nickpeihl / Fire_Zones.geojson
Last active November 16, 2015 17:24
San Juan County Fire Zones
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nickpeihl
nickpeihl / emptyTile
Created January 27, 2016 19:53
Missing or blank tile generation using Imagemagick
convert -size 256x256 -background "rgb(204,204,204)" -fill white -font "Century-Gothic-Bold-Italic" -pointsize 18 -gravity Center caption:"Map data not available. \n\nPlease zoom out or switch to a different basemap." missing.png
@nickpeihl
nickpeihl / index.html
Last active January 27, 2016 23:24
San Juan County Aerials in Mapbox-GL.js
<!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.12.5/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.5/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }