Fix json rendering of large osm ids #7142
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #7069 #7016 #6758 #6594 #5716
This patch introduces a new class for OSM ids to the JSON stack.
The current JSON stack rounds OSM ids to a precision of 10 digits, which is insufficient to represent current OSM node ids.
Also, the current JSON stack converts OSM ids from
uint64_t
todouble
. Thedouble
type has ~53bits of accuracy, the rest going into exponent and sign, which are wasted here. Why is this important even if OSM is still far away from using 53 bits for node ids? Because some people use high ids for their own private data to avoid conflicts with the ids in the OSM database. See: #7069This patch stores OSM ids into
uint64_t
and provides a different output format thus guaranteeing correct output under all circumstances.This pull request is an alternative to: #7096
Tasklist