This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************** | |
* OSM2GEO - OSM to GeoJSON converter | |
* OSM to GeoJSON converter takes in a .osm XML file as input and produces | |
* corresponding GeoJSON object. | |
* | |
* AUTHOR: P.Arunmozhi <aruntheguy@gmail.com> | |
* DATE : 26 / Nov / 2011 | |
* LICENSE : WTFPL - Do What The Fuck You Want To Public License | |
* LICENSE URL: http://sam.zoy.org/wtfpl/ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//MIT License | |
//Author: Max Irwin, 2011 | |
//Floodfill functions | |
function floodfill(x,y,fillcolor,ctx,width,height,tolerance) { | |
var img = ctx.getImageData(0,0,width,height); | |
var data = img.data; | |
var length = data.length; | |
var Q = []; | |
var i = (x+y*width)*4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var userMap = function() { | |
day = Date.UTC(this.created_at.getFullYear(), this.created_at.getMonth(), this.created_at.getDate()); | |
emit({ day: day, user_id: this.user_id }, { count: 1 }); | |
} | |
var userReduce = function(key, values) { | |
var count = 0; | |
values.forEach(function(v) { | |
count += v['count']; |