{"size": 640, "ext": "js", "max_stars_repo_path": "test/test.js", "max_stars_repo_name": "hotosm/oam-catalog-grid", "max_stars_repo_stars_event_min_datetime": "2017-03-07T09:57:55.000Z", "max_stars_repo_stars_event_max_datetime": "2017-03-07T09:57:55.000Z", "max_issues_repo_path": "test/test.js", "max_issues_repo_name": "hotosm/oam-catalog-grid", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/test.js", "max_forks_repo_name": "hotosm/oam-catalog-grid", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.4761904762, "max_line_length": 86, "alphanum_fraction": 0.6609375}
var fs = require('fs')
var test = require('tap').test
var aggregate = require('geojson-polygon-aggregate')
var features = require('geojson-stream').parse
var catalog = require('../read-catalog')
var aggs = require('../first-layer')

test(function (t) {
  fs.createReadStream(__dirname + '/fixture/catalog.json')
  .pipe(catalog())
  .pipe(features())
  .pipe(aggregate(aggs.aggregations.footprints))
  .on('data', function (results) {
    var expected = JSON.parse(fs.readFileSync(__dirname + '/fixture/aggregated.json'))
    for (var p in results) {
      t.same(results[p].split(','), expected[p].split(','), p)
    }
    t.end()
  })
})
