Simplify expression

This commit is contained in:
Javier Goizueta
2018-01-31 17:54:40 +01:00
parent d1fcd797a3
commit 7db0744f67
@@ -132,10 +132,8 @@ const dimensionDefs = ctx => {
// 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 => {
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`;
return `GREATEST(${256*0.00028/ctx.res}*!scale_denominator!, ${minimum_resolution})::double precision`;
};
// Notes: