Skip to content

Json_render is not accurate for osm node ID #7016

Open
@fenwuyaoji

Description

@fenwuyaoji

Issue

@Rejudge-F, @DennisOSRM, @SiarheiFedartsou Hi, all. We are facing an inaccurate OSM node ID format issue and I found it's related to #6531.

The case is:
original node ID: 11117421192, after format: 1.111742119e+10.

The reason I think is that PackedOSMIDs

using PackedOSMIDs = util::detail::PackedVector<OSMNodeID, 34, Ownership>;
is 34 bits and the max length of it is 11. Why do we limit the number length to less than 10? I noticed that before #6531, we only limited the decimal to less than 10, but now we limit the whole number. should we rollback to the previous version or just relax the length to 11?

Steps to reproduce

Add below test case to unit_tests/util/json_render.cpp.

    output.clear();
    renderer(11117421192);
    BOOST_CHECK_EQUAL(output, "1.111742119e+10");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions