Polyline
Polyline copied to clipboard
Higher precision not reflected in sanity check
I have found that a polyline with 1e7 precision will often fail to decode. After some investigation I think the cause is here:
if (componentCounter == 6) && ((currentChar & 0x20) == 0x20) {
throw PolylineError.singleCoordinateDecodingError
}
The limit of five components is easy to exceed with a higher-precision line.
It would be possible to vary the limit, and quite easy if you were able to move to an integer exponent for the precision argument, but I suggest that you could also safely omit this whole sanity check. Big numbers here are implausible but not invalid :)