osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Json_render is not accurate for osm node ID

Open fenwuyaoji opened this issue 1 year ago • 8 comments

Issue

@Rejudge-F, @DennisOSRM, @SiarheiFedartsou Hi, all. We are facing an inaccurate OSM node ID format issue and I found it's related to https://github.com/Project-OSRM/osrm-backend/pull/6531.

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

The reason I think is that PackedOSMIDshttps://github.com/Project-OSRM/osrm-backend/blob/203314b1aa5a4cbbd32b8bd47a5c68399bd9d04e/include/extractor/packed_osm_ids.hpp#L12 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 https://github.com/Project-OSRM/osrm-backend/pull/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");

fenwuyaoji avatar Aug 16 '24 03:08 fenwuyaoji