Merge pull request #243 from CartoDB/241-webmercator
Compute webmercator resolution with full accuracy
This commit is contained in:
@@ -6,7 +6,7 @@ CREATE OR REPLACE FUNCTION CDB_XYZ_Resolution(z INTEGER)
|
|||||||
RETURNS FLOAT8
|
RETURNS FLOAT8
|
||||||
AS $$
|
AS $$
|
||||||
-- circumference divided by 256 is z0 resolution, then divide by 2^z
|
-- 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;
|
$$ LANGUAGE SQL IMMUTABLE STRICT;
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user