Osrm-backend: negative distance in table

Created on 11 Dec 2018  路  3Comments  路  Source: Project-OSRM/osrm-backend

Hi guys,
I found we have a small ratio of negative values (distances) in table request both in CH and MLD algorithms (~0.06% of the points) and fallback_speed qs doesn't solve it in MLD (it solves null values but not negative ones)
I have a bunch of examples if you want to have some test cases but you can have this one for now:
/table/v1/driving/51.46926590005908508,35.73502510786056519;51.47071576056222852,35.73375910520553589?destinations=0&generate_hints=false&annotations=distance&fallback_speed=1

and as far as I know, negative values are just in distances not in duration.

P.S: it didn't happen in single routing (/route/v1/driving/) requests, just in the table. and I have tested it both on v5.18 & v5.20

Here you can see the single route on the map:
screen shot 1397-09-20 at 13 45 51

route response:

{
  "code": "Ok",
  "routes": [
    {
      "legs": [
        {
          "steps": [],
          "distance": 270.3,
          "duration": 43.4,
          "summary": "",
          "weight": 43.4
        }
      ],
      "distance": 270.3,
      "duration": 43.4,
      "weight_name": "routability",
      "weight": 43.4
    }
  ],
  "waypoints": [
    {
      "name": "丕讴亘乇蹖",
      "location": [
        51.470676,
        35.733667
      ]
    },
    {
      "name": "賴賮鬲賲",
      "location": [
        51.469269,
        35.735031
      ]
    }
  ]
}

table response:

{
  "code": "Ok",
  "distances": [
    [
      0
    ],
    [
      -216.9
    ]
  ],
  "sources": [
    {
      "distance": 0.718917,
      "location": [
        51.469269,
        35.735031
      ],
      "name": "賴賮鬲賲"
    },
    {
      "distance": 10.830096,
      "location": [
        51.470676,
        35.733667
      ],
      "name": "丕讴亘乇蹖"
    }
  ],
  "destinations": [
    {
      "distance": 0.718917,
      "location": [
        51.469269,
        35.735031
      ],
      "name": "賴賮鬲賲"
    }
  ]
}

Most helpful comment

Found the bug - fix over in https://github.com/Project-OSRM/osrm-backend/pull/5315. I'll finish this up on Monday and get it included in 5.21.0, which I plan to release early next week.

All 3 comments

@AliKarami I can confirm I see the same thing - I grabbed a small extract from OSM around the coordinates you supplied and ran the same query with master - I get the same negative value. Stay tuned, I'll look into it.

Found the bug - fix over in https://github.com/Project-OSRM/osrm-backend/pull/5315. I'll finish this up on Monday and get it included in 5.21.0, which I plan to release early next week.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Oyabi picture Oyabi  路  5Comments

ltsstar picture ltsstar  路  5Comments

JamesLawrenceGSI picture JamesLawrenceGSI  路  3Comments

stvno picture stvno  路  3Comments

Eichenherz picture Eichenherz  路  4Comments