From 44424583f0c222a876dde7cf00070939bcad7a6e Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 5 Apr 2018 12:12:58 +0200 Subject: [PATCH] Revert "Use unique cartodb_id in aggregated results" This reverts commit c1da1a8a169d574e248809d095e67cb5955d7573. This is reverted for moving the change out of PR #913 into its own PR for clarity. --- lib/cartodb/models/aggregation/aggregation-query.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/cartodb/models/aggregation/aggregation-query.js b/lib/cartodb/models/aggregation/aggregation-query.js index cfb9855a..02211a7d 100644 --- a/lib/cartodb/models/aggregation/aggregation-query.js +++ b/lib/cartodb/models/aggregation/aggregation-query.js @@ -290,7 +290,7 @@ const aggregationQueryTemplates = { !bbox! AS bbox ) SELECT - MIN(_cdb_query.cartodb_id) AS cartodb_id, + row_number() over() AS cartodb_id, ST_SetSRID( ST_MakePoint( AVG(ST_X(_cdb_query.the_geom_webmercator)), @@ -317,7 +317,6 @@ const aggregationQueryTemplates = { ), _cdb_clusters AS ( SELECT - MIN(_cdb_query.cartodb_id) AS cartodb_id, Floor(ST_X(_cdb_query.the_geom_webmercator)/_cdb_params.res)::int AS _cdb_gx, Floor(ST_Y(_cdb_query.the_geom_webmercator)/_cdb_params.res)::int AS _cdb_gy ${dimensionDefs(ctx)} @@ -328,7 +327,7 @@ const aggregationQueryTemplates = { ${havingClause(ctx)} ) SELECT - _cdb_clusters.cartodb_id AS cartodb_id, + row_number() over() AS cartodb_id, ST_SetSRID(ST_MakePoint((_cdb_gx+0.5)*res, (_cdb_gy+0.5)*res), 3857) AS the_geom_webmercator ${dimensionNames(ctx)} ${aggregateColumnNames(ctx)}