Skip to content

Instantly share code, notes, and snippets.

View aaronlidman's full-sized avatar

Aaron Lidman aaronlidman

View GitHub Profile
2017-12-07T00:00 236 48 30
2017-12-07T00:01 718 169 72
2017-12-07T00:02 359 215 30
2017-12-07T00:03 403 86 13
2017-12-07T00:04 214 9 5
2017-12-07T00:05 743 75 6
2017-12-07T00:06 220 53 5
2017-12-07T00:07 14 18 0
2017-12-07T00:08 7 26 3
2017-12-07T00:09 0 16 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
distance (meters) ETA (seconds) # of steps
87017 5078 93
71329 4382 61
142998 7742 47
185510 10536 104
138129 8142 67
157553 8919 89
143918 8489 47
103281 6187 32
// cache osm nodes and ways in leveldb
var osmium = require('osmium');
levelup = require('levelup');
if (process.argv[2] === undefined) {
return console.log('specify a file: `node osmium.js [file]');
}
var db = levelup('./' + (process.argv[3] || 'test.ldb'));
var osmium = require('osmium');
var reader = new osmium.Reader(file, {'node': true});
// storing all nodes and all positions they've ever had
var osmium = require('osmium'),
levelup = require('levelup'),
args = require('minimist')(process.argv.slice(2));
var db;
var reader;
var batch = [];
var batchSize = args.batch || 50000;
// just store the coordinates of every node
var osmium = require('osmium'),
levelup = require('levelup'),
args = require('minimist')(process.argv.slice(2));
var db;
var reader;
var batch = [];
var batchSize = args.batch || 50000;
// just store the coordinates of every node
var osmium = require('osmium'),
levelup = require('levelup'),
args = require('minimist')(process.argv.slice(2));
var db;
var reader;
var batch = [];
var batchSize = args.batch || 50000;
var osmium = require('osmium');
var users = {};
var reader = new osmium.Reader(process.argv[2], {
'node': true,
'way': true,
'relation': true
});
var handler = new osmium.Handler();
var osmium = require('osmium');
if (process.stdin.isTTY) {
if (process.argv[2] === undefined) {
return console.log('specify a file: `node relevant.js [file].osc` or a list of files: `ls *.osc | node relevant.js`');
}
console.log(process.argv[2]);
relevant(process.argv[2]);
} else {
process.stdin.on('readable', function() {