optionally hit worker even if some sources didn't hold data for the tile
See original GitHub issuePer this code:
for (var i = 0; i < results.length; i++) {
data[sources[i].name] = results[i];
if (!results[i]) return process.send({reduce: true});
}
the worker bails out and returns a reduce event if any source doesn’t have data for the requested tile. This is usually great, but in some cases where you want to compare disparate data sources and are relying on reduce events to send back information about how much data each source does or doesn’t exist in a tile, you end up losing information.
For example, if I want to find the length of roads in San Francisco that are matched by GPS datapoints. I would like to keep a tally of the total length of road in the bbox, as well as how much is matchable by GPS points. Right now, if there is no GPS data in the tile, we bail out, so I’m missing some of the total length information.
To maintain compatibility and provide optimization for the usual cases where you want this bail-out behavior, I’m proposing we add a tile-reduce option for this, maybe requireAllSources: false (defaulted true).
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (4 by maintainers)

Top Related StackOverflow Question
bump. any further thoughts here? I’m fine with having 3 modes per @morganherlocker’s
requireData:'all'requireData:'any'requireData:'none'@mourner @aaronlidman
Hello from the future! I am running into this today and would also love to have this feature. I’m hacking in a workaround for now, but excited for #110.