Commit 915f67f0 authored by Volker Krause's avatar Volker Krause Committed by Torsten Rahn

Fix precision loss when passing coordinates to the clipper library

This intends to convert coordinates to 100 nanodegree integer values
(the OSM base resolution), however it misses the fact that the input
is provided in radians, not degrees. This means that we are effectively
reducing the resolution by about 60x. This is enough to introduce visual
glitches up to completely destroying sub-meter structures.
parent ff3ce917
......@@ -87,7 +87,8 @@ enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
struct IntPoint {
cInt X;
cInt Y;
constexpr static qint64 const scale = 10000000;
// convert radian-based coordinates to 10^-7 degree (100 nanodegree) integer coordinates used by the clipper library
constexpr static qint64 const scale = 10000000 / M_PI * 180;
#ifdef use_xyz
cInt Z;
IntPoint(cInt x = 0, cInt y = 0, cInt z = 0): X(x), Y(y), Z(z) {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment