Precision of encoded points

I noticed precision of paths.points is 6 digits when points_encoded is set to false and 5 digits when retrieved through EncodedLineString. Is that how it should be or am I doing something wrong?

Thanks!

It seems it was never noticed that there is a difference. The polyline encoding is defined with 1e5 precision and so we used the same. The LineString however was even unrounded in early times and so we introduced at some point a project-wide precision of 1e6 as near equator a 1e5 precision could mean a ~0.6m error and I probably just wanted to be conservative but cannot remember the details of that decision.

If this difference makes problems - can you describe it in detail?

A subtle one, it seems a point falls in between two highways lanes and the GPS navigator thinks it is in the opposite one. However, I’m not sure this is really a precision issue or rather due to the fact the map in the GPS device is slightly different.

Here s how it looks in OSM:

Point 21 is slightly off and the GPS device recognize it on the other lane, messing up the route

Just wondering if additional precision would help-

Likely a high precision won’t help in this case. You would need to handle it similar we do map matching I guess (but not 100% certain about your exact use case).

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.