Merge pull request #243 from CartoDB/241-webmercator

Compute webmercator resolution with full accuracy
This commit is contained in:
Javier Goizueta 2016-04-25 17:30:40 +02:00
commit efe381ad94

View File

@ -6,7 +6,7 @@ CREATE OR REPLACE FUNCTION CDB_XYZ_Resolution(z INTEGER)
RETURNS FLOAT8
AS $$
-- circumference divided by 256 is z0 resolution, then divide by 2^z
SELECT 40075017.0 / 256 / power(2, z);
SELECT 6378137.0*2.0*pi() / 256.0 / power(2.0, z);
$$ LANGUAGE SQL IMMUTABLE STRICT;
-- }