Skip to content

Instantly share code, notes, and snippets.

@jonahadkins
Created April 27, 2016 20:29
Show Gist options
  • Save jonahadkins/e96234856a9061fe99c3607d8ce2ae40 to your computer and use it in GitHub Desktop.
Save jonahadkins/e96234856a9061fe99c3607d8ce2ae40 to your computer and use it in GitHub Desktop.
'use strict';
var tileReduce = require('tile-reduce');
var path = require('path');
var numFeatures = 0;
tileReduce({
//test bbox area
bbox: [-77.033, 36.855, -76.073, 37.468],
// mapbox qa tiles are done at zoom 12
zoom: 12,
//__dirname is a magic variable the node knows what to do with
map: path.join(__dirname, './map.js'),
sources: [{name: 'osm', mbtiles: path.join(__dirname, './usa.mbtiles'), raw: false}]
})
.on('reduce', function(num) {
numFeatures += num;
})
.on('end', function() {
console.log('Features total: %d', numFeatures);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment