Fix bug in point-grid aggregation

This commit is contained in:
Javier Goizueta 2017-12-14 12:12:43 +01:00
parent bcfc43a517
commit daa3fdca11

View File

@ -50,6 +50,7 @@ const SUPPORTED_AGGREGATE_FUNCTIONS = {
}; };
const aggregateColumns = ctx => { const aggregateColumns = ctx => {
// TODO: always add count
let columns = ctx.columns || {}; let columns = ctx.columns || {};
if (Object.keys(columns).length === 0) { if (Object.keys(columns).length === 0) {
// default aggregation // default aggregation
@ -117,7 +118,7 @@ const aggregationQueryTemplates = {
GROUP BY _cdb_gx, _cdb_gy GROUP BY _cdb_gx, _cdb_gy
) )
SELECT 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 _cdb_feature_count
FROM _cdb_clusters, _cdb_params FROM _cdb_clusters, _cdb_params
`, `,