Fix: should be floating point divistion, not integer division

This commit is contained in:
Javier Goizueta 2016-01-29 16:51:52 +01:00
parent 6a11698a16
commit 06dd31f4ad

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 / 256 / power(2, z);
SELECT 40075017.0 / 256 / power(2, z);
$$ LANGUAGE SQL IMMUTABLE STRICT;
-- }