From 4580c9cd5c2a99eba3122fc76eef7ce5fdce82cb Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Mon, 4 Jan 2016 10:33:39 +0100 Subject: [PATCH] Change the cartodb_ids of aggregated overviews Instead of arbitrary ids, the id of one of the aggregated records is used, so that if it is used in the UI to query point the information of one of the records grouped at the point will be retrieved. --- scripts-available/CDB_Overviews.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-available/CDB_Overviews.sql b/scripts-available/CDB_Overviews.sql index 15b1aa1..aaadf45 100644 --- a/scripts-available/CDB_Overviews.sql +++ b/scripts-available/CDB_Overviews.sql @@ -386,7 +386,7 @@ AS $$ SUM(ST_Y(f.the_geom_webmercator)) AS sy, Floor(ST_X(f.the_geom_webmercator)/%2$s)::int AS gx, Floor(ST_Y(f.the_geom_webmercator)/%2$s)::int AS gy, - row_number() OVER () AS cartodb_id + MIN(cartodb_id) AS cartodb_id FROM %1$s f GROUP BY gx, gy )