Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in double / coordinate printing #570

wants to merge 69 commits into from


Copy link

  • Use the shortest representation (enough to guarantee roundtrip).
  • Uses scientific notation for absolute numbers smaller than 1e-8. The previous behaviour was to output 0 for absolute values smaller than 1e-12 and fixed notation for anything bigger than that.
  • Uses scientific notation for absolute numbers greater than 1e+15 (same behaviour).
  • The precision parameter now also affects the scientific notation (before it was fixed [5-8]).
  • All output functions now respect the requested precision (without any limits).
  • The default precision is the same (9 for GeoJSON, 15 for everything else).

Unit tests in

Many regress test changed mainly because of the fixes to the precision parameter, which is now respected as the amount of digits after the fixed point.

The changes here are due to ST_Transform not retuning exact integer. With the previous
buggy implementation, we weren't returning all the required decimal digits so the
rounding turned them into ints (but they weren't). After fixing that we show
the correct value
ST_SnapToGrid is NOT a valid way to truncate precision in the output,
since floating point is, by design, innexact as thus you might be
trying to clip to an unrepresentable value. Instead use the ST_AsText
precision parameter
Changes in the scientific notation, as it now prints all
significant digits
@strk strk closed this in 1343712 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
1 participant