Skip to content

Instantly share code, notes, and snippets.

@mapsam
mapsam / readme.md
Created February 10, 2016 20:55
Mapnik Debug

Mapnik and the Mapnik-related tools have a series of useful debugging tools built into their repositories. Since these live across repos, it can be difficult to remember where they exist or even if know if they exist. This lists out all of the useful bin commands that have been built for debugging purposes when working on Mapnik.

node-mapnik

located at: https://github.com/mapnik/node-mapnik/tree/master/bin

  • mapnik-index.js
  • mapnik-inspect.js
  • mapnik-render.js
  • mapnik-shapeindex.js
@mapsam
mapsam / painted.md
Created February 19, 2016 20:22
Solid, painted, empty

Painted

Blake described a painted tile like this:

Think about if I was rendering a 0/0/0 tile from postgis and there was only a small park in my data. It would probably collapse to nothing at 0/0/0 resolution so the entire tile would be empty. So the tile would be considered empty, but there was originally data below it so for pyramid rendering we want to know that you can’t just copy this tile from now on. Therefore painted says “hey! there was some data!"(edited)

@mapsam
mapsam / usage.js
Created March 1, 2016 01:58
node-mapnik usage example
var fs = require('fs');
var map = new mapnik.Map(256, 256),
img = new mapnik.Image(256, 256),
data = fs.readFileSync('/path/to/data.shp'),
vectortile = new mapnik.VectorTile(0,0,0);
// add shapefile to vector tile
vectortile.addData(data, function(err) {
if (err) throw err;
@mapsam
mapsam / ballard-labs.md
Last active March 10, 2016 23:01
Co-working spaces in Seattle
@mapsam
mapsam / error.point.geojson
Last active March 14, 2016 19:48
validity check
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mapsam
mapsam / .md
Last active April 7, 2016 22:29
c++ dependent dependents
version dependency dep version description
@mapsam
mapsam / bench.js
Created May 12, 2016 23:22
node-mapnik bencharmking for protozero
var mapnik = require('mapnik');
var fs = require('fs');
var iterations = 20000,
i = total = 0,
max = -Infinity,
min = Infinity,
tile = './785.vector.pbf';
decode();
@mapsam
mapsam / .js
Created May 13, 2016 18:46
report node-mapnik validty/simplicity
#!/usr/bin/env node
"use strict";
var exists = require('fs').existsSync || require('path').existsSync;
var fs = require('fs');
var usage = 'usage:';
usage += '\n mapnik-info.js <tile.mvt> z x y';
var tile = process.argv[2];
@mapsam
mapsam / meetup-announcement.md
Last active June 17, 2016 22:46
MapboxSEA Git Lesson

We are going to jump into Git, the version control system behind GitHub. Many projects, geospatial or otherwise, rely on git to track changes made to source code and documentation so people can work collaboratively without accidental code deletions.

Lesson breakdown

  1. Git vocabulary quest
  2. GitHub and social coding
  3. Introduction to the command line
  4. Standard Git workflow
  5. Maps & GitHub
  6. Websites with GitHub pages (if time permits)
@mapsam
mapsam / .md
Last active July 29, 2016 16:03
Mapsam.com resume

The website is jekyll-based (which you know plenty about!). The resume page at mapsam.com/resume uses these key files:

  1. _layouts/resume.html: this is template for the resume page. You'll notice a few different for loops on this page that look for jobs, cv items, and extras formally declared as "things" because I couldn't come up with a better word 😄
  2. resume/index.md: this is the meat of the potato, where all of the "data" for the resume exist. Notice in the YAML (the syntax for the top part of the file between the --- triple dashes) there are sections for jobs