Merge pull request #812 from CartoDB/fix-agg-point-sample-grid

Use source query as attribute instead of function
This commit is contained in:
Raul Ochoa 2017-12-14 19:58:46 +01:00 committed by GitHub
commit 55d9c02f8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,7 +151,7 @@ const aggregationQueryTemplates = {
Floor(ST_Y(_cdb_query.the_geom_webmercator)/_cdb_params.res)::int AS _cdb_gy Floor(ST_Y(_cdb_query.the_geom_webmercator)/_cdb_params.res)::int AS _cdb_gy
${dimensionDefs(ctx)} ${dimensionDefs(ctx)}
${aggregateColumnDefs(ctx)} ${aggregateColumnDefs(ctx)}
FROM (${ctx.sourceQuery(ctx)}) _cdb_query, _cdb_params FROM (${ctx.sourceQuery}) _cdb_query, _cdb_params
WHERE the_geom_webmercator && _cdb_params.bbox WHERE the_geom_webmercator && _cdb_params.bbox
GROUP BY _cdb_gx, _cdb_gy ${dimensionNames} GROUP BY _cdb_gx, _cdb_gy ${dimensionNames}
) )
@ -172,7 +172,7 @@ const aggregationQueryTemplates = {
MIN(cartodb_id) AS cartodb_id MIN(cartodb_id) AS cartodb_id
${dimensionDefs(ctx)} ${dimensionDefs(ctx)}
${aggregateColumnDefs(ctx)} ${aggregateColumnDefs(ctx)}
FROM (${ctx.sourceQuery(ctx)}) _cdb_query, _cdb_params FROM (${ctx.sourceQuery}) _cdb_query, _cdb_params
WHERE _cdb_query.the_geom_webmercator && _cdb_params.bbox WHERE _cdb_query.the_geom_webmercator && _cdb_params.bbox
GROUP BY GROUP BY
Floor(ST_X(_cdb_query.the_geom_webmercator)/_cdb_params.res), Floor(ST_X(_cdb_query.the_geom_webmercator)/_cdb_params.res),
@ -184,7 +184,7 @@ const aggregationQueryTemplates = {
${dimensionNames(ctx)} ${dimensionNames(ctx)}
${aggregateColumnNames(ctx)} ${aggregateColumnNames(ctx)}
FROM FROM
_cdb_clusters INNER JOIN (${ctx.sourceQuery(ctx)}) _cdb_query _cdb_clusters INNER JOIN (${ctx.sourceQuery}) _cdb_query
ON (_cdb_clusters.cartodb_id = _cdb_query.cartodb_id) ON (_cdb_clusters.cartodb_id = _cdb_query.cartodb_id)
` `
}; };