Skip to content

negative distance in table #5306

@AliKarami

Description

@AliKarami

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": "هفتم"
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions