Skip to content

Instantly share code, notes, and snippets.

@gravitystorm
gravitystorm / instructions.md
Created October 7, 2016 09:04
Steps to replace fixtures with factories

These are instructions for replacing fixtures with factories, developed for https://github.com/openstreetmap/openstreetmap-website

  • Run the tests

Make sure all the tests pass (bundle exec rake test) before starting!

  • Choose the fixture

Pick a fixture file from test/fixtures. If they come in pairs (e.g. notes.yml and note_comments.yml) it's easier to do both at the same time. Have a read through, and get a rough idea of what the differences are between each of the fixtures.

There were 424 committers in total.
2015 had 118 committers, of which 69 were new
2014 had 117 committers, of which 68 were new
2013 had 144 committers, of which 98 were new
2012 had 79 committers, of which 39 were new
2011 had 66 committers, of which 30 were new
2010 had 59 committers, of which 27 were new
2009 had 63 committers, of which 30 were new
2008 had 51 committers, of which 34 were new
2007 had 29 committers, of which 25 were new
@gravitystorm
gravitystorm / footpathway.md
Last active September 2, 2015 20:44
highway=path vs highway=footway

"path is only needed when footway, cycleway or bridleway are misleading"

"There's no clear default for path, footway or every cycleway about surface. The obvious answer is that surface tags should be used."

"without any further access tags, path is neutral and open to all unmotorized means of transport (unlike footway, cycleway etc.)"

"highway=footway is meant to be the same as highway=path and foot=designated"

"But =footway and =path mean different things in different regions"

@gravitystorm
gravitystorm / email.md
Last active August 29, 2015 14:17
In which I wish there were newer tilemill releases

My apologies - I didn't anticipate this problem! The short answer is that you need to install tilemill from source for this to work.

The long answer is as follows. The polgyon-geometry-transform feature was available in mapnik in version 2.1.0 onwards, released in August 2012 [1]. The latest tilemill release is v0.10.1, released in October 2012 [2].

mapnik-reference is the project within tilemill which tells tilemill what features are available in mapnik. Information about polygon-geometry-transform was only added in March 2013 [3], in version 5.0.5. Tilemill 0.10.1 depends on "mapnik-reference 5.0.x" but shipped with version 5.0.0 . So reinstalling from source will make it use the latest 5.0.x mapnik-reference (5.0.9), and that contains the information about polygon-geometry-transform.

I use tilemill 0.10.1 myself, but I installed it from source at some point after March 2013, which is why I didn't realise there would be a problem!

There were 361 committers in total.
2015 had 16 committers, of which 3 were new
2014 had 116 committers, of which 70 were new
2013 had 145 committers, of which 98 were new
2012 had 80 committers, of which 39 were new
2011 had 67 committers, of which 31 were new
2010 had 59 committers, of which 27 were new
2009 had 63 committers, of which 30 were new
2008 had 51 committers, of which 34 were new
2007 had 29 committers, of which 25 were new
andy@eiger:~/temp/bar$ diff -u -r osm2pgsql-git/ osm2pgsql
Only in osm2pgsql: aclocal.m4
Only in osm2pgsql: config.guess
Only in osm2pgsql: config.h.in
Only in osm2pgsql: config.sub
Only in osm2pgsql: configure
diff -u -r osm2pgsql-git/debian/changelog osm2pgsql/debian/changelog
--- osm2pgsql-git/debian/changelog 2014-12-22 12:50:57.872727114 +0000
+++ osm2pgsql/debian/changelog 2012-09-14 07:26:21.000000000 +0100
@@ -1,3 +1,12 @@
@gravitystorm
gravitystorm / index.js
Created June 10, 2014 09:49
unwrapped tilelive-http
"use strict";
var http = require("http"),
url = require("url");
var request = require("request");
var version = require("./package.json").version;
http.globalAgent.maxSockets = 100;
module.exports = HttpSource;
There were 297 committers in total.
2014 had 41 committers, of which 9 were new
2013 had 144 committers, of which 98 were new
2012 had 80 committers, of which 39 were new
2011 had 67 committers, of which 31 were new
2010 had 59 committers, of which 27 were new
2009 had 63 committers, of which 30 were new
2008 had 51 committers, of which 34 were new
2007 had 29 committers, of which 25 were new
2006 had 4 committers, of which 4 were new
@gravitystorm
gravitystorm / index.js
Created March 21, 2014 17:31
mbtiles stopWriting not reentrant?
#!/usr/bin/env node
var tilelive = require('tilelive');
var Mbtiles = require('mbtiles');
var Http = require('tilelive-http');
tilelive.protocols['mbtiles:'] = Mbtiles;
tilelive.protocols['http:'] = Http;
var source = new Http("http://tile.openstreetmap.org/{z}/{x}/{y}.png", function(err) { if (err) throw err} );