parent
33ed9ab47d
commit
d1fcd797a3
@ -131,7 +131,12 @@ const dimensionDefs = ctx => {
|
|||||||
// This is equivalent to `${256/ctx.res}*CDB_XYZ_Resolution(CDB_ZoomFromScale(!scale_denominator!))`
|
// 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
|
// 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).
|
// (i.e. each tile is divided into ctx.res*ctx.res cells).
|
||||||
const gridResolution = ctx => `(${256*0.00028/ctx.res}*!scale_denominator!)::double precision`;
|
const gridResolution = ctx => {
|
||||||
|
const factor = 256*0.00028/ctx.res;
|
||||||
|
const minimum_resolution = 2*Math.PI*6378137/Math.pow(2,38);
|
||||||
|
let minimum_scale_denominator = minimum_resolution/factor;
|
||||||
|
return `(${factor}*GREATEST(!scale_denominator!,${minimum_scale_denominator}))::double precision`;
|
||||||
|
};
|
||||||
|
|
||||||
// Notes:
|
// Notes:
|
||||||
// * We need to filter spatially using !bbox! to make the queries efficient because
|
// * We need to filter spatially using !bbox! to make the queries efficient because
|
||||||
|
Loading…
Reference in New Issue
Block a user