Files
Windshaft-cartodb/lib/cartodb/models/aggregation/aggregation.js
T
Javier Goizueta f95c310462 Redefine aggregation torque to match Torque
Now the resolution aggregation parameter has the same meaning as in Torque (-torque-resolution in CartoCSS)
2017-12-14 17:04:23 +01:00

25 lines
603 B
JavaScript

const aggregationQuery = require('./aggregation-query');
module.exports = class Aggregation {
static get THRESHOLD() {
return 1e5; // 100K
}
constructor (mapconfig, query, {
resolution = 1,
threshold = Aggregation.THRESHOLD,
placement = 'centroid',
columns = {}
} = {}) {
this.mapconfig = mapconfig;
this.query = query;
this.resolution = resolution;
this.threshold = threshold;
this.placement = placement;
this.columns = columns;
}
sql () {
return aggregationQuery(this);
}
};