Files
Windshaft-cartodb/lib/cartodb/models/aggregation/aggregation.js
T
Javier Goizueta 4a63fed943 Simplify Aggregation classes
We're using the same aggregation queries for the Raster and Vector cases, so we don't need the class hierarchies used to handled them differently.
AggregationProxy has been renamed to Aggregation
2017-12-13 12:35:17 +01:00

25 lines
605 B
JavaScript

const aggregationQuery = require('./aggregation-query');
module.exports = class Aggregation {
static get THRESHOLD() {
return 1e5; // 100K
}
constructor (mapconfig, query, {
resolution = 256,
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);
}
};