I would say that the first thing to do to diagnose the problem is to find the shortest possible path (fewest edges) that exhibit this problem for you.
At first glance, I'd say that your BPR values aren't what you think they are somewhere along your route, but it's impossible to say exactly where they might be incorrect. daniel On Tue, Apr 14, 2020 at 2:39 AM Niharika Shrivastava < chunnushrivast...@gmail.com> wrote: > Hello, I'm new to OSRM and I went through previous issues and couldn't > find much related to this, hence posting it here. > > I had used a python library OSMnx to extract Singapore's data and changed > certain edge attributes for it. I calculated an edge attribute `"BPR"` > (float) and stored it in the graph (This is travel time in case of real > traffic data). I then converted this modified graph into a shapefile and > then converted the shapefile into OSM XML using JOSM. I fed this to OSRM in > order to use CH. I want to find the shortest route between two points > wherein my weights (or cost) are the BPR value I had calculated. I > understand I have to specify that in the car profile. This is how I > specified it: > > ``` > function setup() > return { > properties = { > ... > weight_name = 'congestion', > ... > }, > ... > } > > > function process_way(profile, way, result, relations) > local data = { > -- prefetch tags > ... > BPR = way:get_value_by_key('BPR') > } > > result.weight = data.BPR > ... > } > ``` > > This is the JSON response I get for a certain query: > ``` > {'code': 'Ok', > 'routes': [{'geometry': 's}gG{ijyReEnNdm@|Wpl@~}@b\\lfAw\\twAbFjt@wM > `ZwSpAGnNgN|Dvm@fWwHhb@bErz@qFxeAzVfkAfr@b{Ak_@rr@ocA~dAgCda@ji@dz@`j@di > @`Sfi@PfQcRpc@ySyCgw@~XjEx]dHDkEl\\ju@lf@ii@n}@oVqEiKlR_Elw@bJd[lc@wFdKf > [', > 'legs': [{'steps': [], > 'distance': 32298.2, > 'duration': 2308.4, > 'summary': '', > 'weight': 2179.6}], > 'distance': 32298.2, > 'duration': 2308.4, > 'weight_name': 'congestion', > 'weight': 2179.6}], > 'waypoints': [{'hint': > 'YwYBgG8GAYALAAAAAQAAAAAAAAAAAAAAHN-XQWpx4j0AAAAAAAAAAA0AAAABAAAAAAAAAAAAAAAJAAAAyOIxBiSzFADI4jEGJLMUAAAAzwFqJcKJ', > 'distance': 0, > 'name': 'Tampines Avenue 8', > 'location': [103.932616, 1.35658]}, > {'hint': > 'EAYBgBcGAYAUAAAAAAAAAAAAAAAAAAAAPzfZQQAAAAAAAAAAAAAAABkAAAAAAAAAAAAAAAAAAAAJAAAA6oIuBlR3FADqgi4GVHcUAAAALwpqJcKJ', > 'distance': 0, > 'name': 'Boon Lay Drive', > 'location': [103.711466, 1.341268]}]} > ``` > > Looking at this part from the JSON: > ``` > 'duration': 2308.4, > 'weight': 2179.6}], > ``` > As I understand, weight is the summation of BPR values for each edge. > Duration is estimated free flow time:` length/max_speed for each edge`. The > `value of weight should be >= duration` which is true when I use Dijkstra > for routing using edge weights as BPR value (`3155.27`). But over here, > thats not the case. > > BPR = duration*(some delay based on traffic) >= duration in case of no > traffic > > Can someone please point out if my Profile is wrongly written or if I've > missed any steps? > _______________________________________________ > OSRM-talk mailing list > OSRM-talk@openstreetmap.org > https://lists.openstreetmap.org/listinfo/osrm-talk >
_______________________________________________ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk