From 9526f0448f8bcedcd114e64f3d2760e01e34f905 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 26 May 2016 18:25:11 +0200 Subject: [PATCH] Fix bug in feature density recursive query If the table had x and/or y columns they were picked by an inner select instead of the recursive arguments. Fixes #256 --- 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 b9ce97d..c1520f2 100644 --- a/scripts-available/CDB_Overviews.sql +++ b/scripts-available/CDB_Overviews.sql @@ -349,7 +349,7 @@ AS $$ UNION ALL SELECT x*2 + xx, y*2 + yy, t.z+1, ( SELECT count(*) FROM %1$s - WHERE the_geom_webmercator && CDB_XYZ_Extent(x*2 + xx, y*2 + yy, t.z+1) + WHERE the_geom_webmercator && CDB_XYZ_Extent(t.x*2 + c.xx, t.y*2 + c.yy, t.z+1) ) FROM t, base, (VALUES (0, 0), (0, 1), (1, 1), (1, 0)) AS c(xx, yy) WHERE t.e > %2$s AND t.z < least(base.z + %3$s, _CDB_MaxZoomLevel())