From daa3fdca119b5702ea4eb7452104361d93be8c4f Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 14 Dec 2017 12:12:43 +0100 Subject: [PATCH] Fix bug in point-grid aggregation --- lib/cartodb/models/aggregation/aggregation-query.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cartodb/models/aggregation/aggregation-query.js b/lib/cartodb/models/aggregation/aggregation-query.js index 7dd55b3c..55ee53ea 100644 --- a/lib/cartodb/models/aggregation/aggregation-query.js +++ b/lib/cartodb/models/aggregation/aggregation-query.js @@ -50,6 +50,7 @@ const SUPPORTED_AGGREGATE_FUNCTIONS = { }; const aggregateColumns = ctx => { + // TODO: always add count let columns = ctx.columns || {}; if (Object.keys(columns).length === 0) { // default aggregation @@ -117,7 +118,7 @@ const aggregationQueryTemplates = { GROUP BY _cdb_gx, _cdb_gy ) SELECT - ST_SetSRID(ST_MakePoint(_cdb_gx*(res+0.5), _cdb_gy*(res*0.5)), 3857) AS the_geom_webmercator, + ST_SetSRID(ST_MakePoint(_cdb_gx*(res+0.5), _cdb_gy*(res+0.5)), 3857) AS the_geom_webmercator, _cdb_feature_count FROM _cdb_clusters, _cdb_params `,