Skip to content

Instantly share code, notes, and snippets.

View apollolm's full-sized avatar

Ryan Whitley apollolm

View GitHub Profile
@apollolm
apollolm / PG9.2Install
Created November 11, 2013 23:43
PostGres 9.2/PostGIS 2.1 install notes Ubuntu 13
--FROM http://blog.mackerron.com/2012/06/01/postgis-2-ubuntu-12-04/
mkdir -p src
# First install PostgreSQL 9.2, plus contributed packages and any missing prerequisites
# ===
# add the Postgres PPA
echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' \
@apollolm
apollolm / gist:7607864
Created November 22, 2013 22:21
Access Summary Geoprocessing Task for Chubbs Spatial Server
//10.17.2013 - Ryan Whitley
var flow = require('flow');
var pg = require('pg'),
common = require("../../../common"),
settings = require('../../../settings');
//Takes in a where clause, buffers, dissolves and zonal stats. Return table of zonal stats.
//Arguments are:
//1. The points (or at least a where clause to query a particular table).
//2. Buffer Radius
@apollolm
apollolm / gist:7624122
Created November 24, 2013 06:50
FSP Cost Surface CartoCSS - How to colorize a raster to store cost values in the blue band of a 1-band raster. Make sure to use the band="1" in the Advanced textbox of the raster properties.
Map {
background-color: #b8dee6;
}
#countries {
::outline {
line-color: #85c5d3;
line-width: 2;
line-join: round;
}
@apollolm
apollolm / SingleTile.js
Last active December 31, 2015 02:29 — forked from Zverik/SingleTile.js
Use this with Leaflet map API to request a single dynamic tile to be generated when user stops panning. Request is made to PGRestAPI (Chubbs Spatial Server)
/*
* from - https://gist.github.com/Zverik/5757305
* L.DynamicSingleTile uses L.ImageOverlay to display a single-tile layer from node-mapnik.
* url parameter must accept width, height and bbox.
*/
L.DynamicSingleTile = L.ImageOverlay.extend({
initialize: function (url, options) {
L.ImageOverlay.prototype.initialize.call(this, url, null, options);
},
@apollolm
apollolm / gist:8720143
Last active August 29, 2015 13:55 — forked from fnicollet/gist:5764080
DynamicSingleTile is similar to SingleTileWMS overlay for Leaflet map framework, except that it's requesting images from a custom Node.js map server built with mapnik (Chubbs Spatial Server/PGRestAPI)
/*
* from - https://gist.github.com/fnicollet/5764080
* Modified by Ryan Whitley - Jan 30, 2013
* L.DynamicSingleTile uses L.ImageOverlay to display a single-tile layer from node-mapnik.
* url parameter must accept width, height and bbox.
*/
L.DynamicSingleTile = L.ImageOverlay.extend({
initialize: function (url, bounds, options) { // (String, Object)
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);
@apollolm
apollolm / api101.html
Created October 6, 2014 04:35
Tech Diversified - API 101 Starter Page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The Power of APIs</title>
</head>
<body>
<h1>List of 911 Responses</h1>
@apollolm
apollolm / map.html
Created October 7, 2014 04:32
A map template for the API workshop
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The Power of APIs</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
@apollolm
apollolm / site.html
Last active August 29, 2015 14:07
Bare bones html file, no javascript. How boring.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The World of JavaScript</title>
<style>
.section{
margin: 20px 0;
@apollolm
apollolm / site_javascript.html
Last active August 29, 2015 14:08
Same HTML as site.html, but with Javascript to make the page interactive
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TechDiversified Worshop - The World of JavaScript</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
.section{