abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
473 stars 113 forks source link

Intermediate nodes on a route break the Data table's Time and Energy values #680

Open boulderalf opened 3 months ago

boulderalf commented 3 months ago

I have noticed that adding intermediate nodes on a route breaks the Data table's Time and Energy values.

Here is an example:

Working as expected

  1. Create a route on a long road with only a start and end point (click here for route)
  2. You will see that the Time and Energy values accumulate over the route. The accumulated Time value is 2748 seconds (0:45 h) and the accumulated Energy value is 274828 J (0.08 kWh). That is as expected. values increase over route

Not working as expected

  1. Add a few intermediate nodes on the route. (click here for route)
  2. Now, the Time and Energy values do not accumulate over the route. The values seem to reset at each intermediate node. No longer can I rely on the Time and Energy values to be an accumulation along the route. values reset at intermediate nodes

Is this a bug? Or am I misreading the data?

quaelnix commented 3 months ago

This is a known error that consists of two problems:

  1. BRouter-Web makes a separate request to BRouter for each leg of the route (which explains why time and energy do not increase monotonically).
  2. Even if BRouter-Web did not do it like this, BRouter would not be able to calculate the time and energy correctly because adding waypoints resets the internal elevation filter, which messes up the time and energy calculation.