Compare commits

...

8 Commits
5.2.0 ... 5.2.1

Author SHA1 Message Date
Javier Goizueta
5aa98c4ab2 Release 5.2.1 2018-02-01 16:37:05 +01:00
Javier Goizueta
d6a9103779 Merge pull request #861 from CartoDB/860-aggregation-min-res
Limit the minimum size of the the aggregation grid
2018-02-01 16:32:35 +01:00
Javier Goizueta
2e7784ddf2 Add comment to clafify aggregation resolution limit 2018-02-01 10:26:52 +01:00
Raul Marin
086be461b2 Stub next version 2018-02-01 09:33:18 +01:00
Javier Goizueta
80604b739a Add test for aggregation with attributes
This reveals #860
2018-01-31 18:56:24 +01:00
Javier Goizueta
d88fbbaa87 Use camelCase 2018-01-31 18:55:28 +01:00
Javier Goizueta
7db0744f67 Simplify expression 2018-01-31 17:54:40 +01:00
Javier Goizueta
d1fcd797a3 Limit the minimum size of the the aggregation grid
Fixes #860
2018-01-31 17:46:13 +01:00
4 changed files with 50 additions and 2 deletions

View File

@@ -1,5 +1,11 @@
# Changelog
## 5.2.1
Released 2018-02-01
Bug Fixes:
- Allow use of aggregation with attributes #861
## 5.2.0
Released 2018-02-01

View File

@@ -131,7 +131,12 @@ const dimensionDefs = ctx => {
// This is equivalent to `${256/ctx.res}*CDB_XYZ_Resolution(CDB_ZoomFromScale(!scale_denominator!))`
// This is defined by the ctx.res parameter, which is the number of grid cells per tile linear dimension
// (i.e. each tile is divided into ctx.res*ctx.res cells).
const gridResolution = ctx => `(${256*0.00028/ctx.res}*!scale_denominator!)::double precision`;
// We limit the the minimum resolution to avoid division by zero problems. The limit used is
// the pixel size of zoom level 30 (i.e. 1/2*(30+8) of the full earth web-mercator extent), which is about 0.15 mm.
const gridResolution = ctx => {
const minimumResolution = 2*Math.PI*6378137/Math.pow(2,38);
return `GREATEST(${256*0.00028/ctx.res}*!scale_denominator!, ${minimumResolution})::double precision`;
};
// Notes:
// * We need to filter spatially using !bbox! to make the queries efficient because

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "windshaft-cartodb",
"version": "5.2.0",
"version": "5.2.1",
"description": "A map tile server for CartoDB",
"keywords": [
"cartodb"

View File

@@ -1438,6 +1438,43 @@ describe('aggregation', function () {
done();
});
});
it('aggregation should work with attributes', function (done) {
this.mapConfig = createVectorMapConfig([
{
type: 'cartodb',
options: {
sql: POINTS_SQL_1,
cartocss: '#layer { marker-width: 7; }',
cartocss_version: '2.3.0',
aggregation: {
threshold: 1
},
attributes: {
id: 'cartodb_id',
columns: [
'value'
]
}
}
}
]);
this.testClient = new TestClient(this.mapConfig);
this.testClient.getLayergroup((err, body) => {
if (err) {
return done(err);
}
assert.equal(typeof body.metadata, 'object');
assert.ok(Array.isArray(body.metadata.layers));
body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt));
body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.png));
done();
});
});
});
});
});