Skip to content

Instantly share code, notes, and snippets.

View amyleew's full-sized avatar

Amy Lee Walton amyleew

View GitHub Profile
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@amyleew
amyleew / scale.md
Last active August 29, 2015 14:11 — forked from ian29/scale.md

scale, and selecting specific zoom levels

Mapnik is very smart about converting map scale to zoom level. As a secret/power user feature, Mapnik exposes a !scale_denominator! variable that changes according to the zoom level and + latitude of the vector tile being rendered. Read about the Mapnik's !scale_denominator! variable here.

With some postgres magic, the !scale_denominator lets us control which features appear and disappear, within a layer.

Concretely this is a two-part process. First you will need to load the following z() function into your PostGIS database:

CREATE OR REPLACE FUNCTION public.z(scaledenominator numeric)
@amyleew
amyleew / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@amyleew
amyleew / map.c
Last active August 29, 2015 14:22 — forked from tmcw/map.js
#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/image.hpp>
#include <mapnik/image_util.hpp>
main() {
mapnik::Map m(256,256);
mapnik::load_map(m, ‘path/to/file.xml’);
m.zoom_all();
@amyleew
amyleew / tmux-cheatsheet.markdown
Created December 4, 2015 19:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname