[OSRM-talk] need help to use
hello i want to use your service in my program. may you lead me ? ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
[OSRM-talk] Need help writing a lua script for public transit (bus)
Hi there I trying to figure out more about the .lua scripts in order to create a profile that would create sensible approximations of bus routes. I know that many public transit routes are modelled as relations in osm. Can someone help me? Tanks Simone ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
Re: [OSRM-talk] Need help: Customizing weights in Profile shows inconsistent results with Dijsktra
Thank you for your reply! I analyzed the full JSON response using the "steps" parameter to check individual weight values for each edge. It looks like the weights are dependent on the duration value calculated. I did not specify how to calculate the duration value at all and assumed its the length/max_speed as given in OSM data. I also didn't specify any relationship between the duration and BPR. "BPR" is just another pre-calculated edge attribute like "max speed" in OSM. This is what is happening right now: I used OSMnx to see the edge attributes for a particular road: {'osmid': 536661786, 'oneway': True, 'name': 'Tampines Avenue 1', 'highway': 'secondary', 'maxspeed': '60.0', 'length': 16.847, 'travel_time': '1.01082', 'Location': '(1.3501839, 103.926145, 1.3502606, 103.9261452)', 'BPR': 1.0297525963481398} I then used OSRM for the same road: {'intersections': [{'out': 3, 'location': [103.926145, 1.350184], 'mode': 'driving', 'duration': 3.5, 'weight': 3.2, 'distance': 16.8, 'name': 'Tampines Avenue 1'} Duration != travel_time and BPR != weight by a huge margin. How is this being calculated? I just want to make sure I wrote my profile correctly. 1. Even if turn penalties or traffic light penalties were added to my weights, the cumulative weight value should've been higher than duration. 2. I saw weight customizations in a `way_function` in the testbot.lua examples. Should I be using this function to customize my weights? 3. How do I make the algorithm use the readily available weights given in my OSM data and not be dependent on duration calculated? Thanking you in advance, Niharika On Tue, Apr 14, 2020 at 9:47 PM Daniel Patterson via OSRM-talk < osrm-talk@openstreetmap.org> wrote: > 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': >> 'YwYBgG8GAYALAQAAHN-XQWpx4j0AAA0BAAAJyOIxBiSzFADI4jEGJLMUzwFqJcKJ', >>'distance': 0, >>'name': 'Tampines Avenue 8', >>'location': [103.932616, 1.35658]}, >> {'hint': >> 'EAYBgBcGAYAUPzfZQQAAABkJ6oIuBlR3FADqgi4GVHcULwpqJcKJ', >>'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
Re: [OSRM-talk] Need help: Customizing weights in Profile shows inconsistent results with Dijsktra
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': > 'YwYBgG8GAYALAQAAHN-XQWpx4j0AAA0BAAAJyOIxBiSzFADI4jEGJLMUzwFqJcKJ', >'distance': 0, >'name': 'Tampines Avenue 8', >'location': [103.932616, 1.35658]}, > {'hint': > 'EAYBgBcGAYAUPzfZQQAAABkJ6oIuBlR3FADqgi4GVHcULwpqJcKJ', >'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
[OSRM-talk] Need help: Customizing weights in Profile shows inconsistent results with Dijsktra
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': 'YwYBgG8GAYALAQAAHN-XQWpx4j0AAA0BAAAJyOIxBiSzFADI4jEGJLMUzwFqJcKJ', 'distance': 0, 'name': 'Tampines Avenue 8', 'location': [103.932616, 1.35658]}, {'hint': 'EAYBgBcGAYAUPzfZQQAAABkJ6oIuBlR3FADqgi4GVHcULwpqJcKJ', '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] Need HELP
I am beginner to Open Street Maps. I want to know, How to create directions/routes from one marker to another marker on a map.IDE usedMicrosoft Visual Studio 2012 ,ASP.NETThank you___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
Re: [OSRM-talk] Need HELP
Try looking at the wiki: https://github.com/DennisOSRM/Project-OSRM/wiki/_pages. It will tell you how to build OSRM, how to use the API, etc. The code for the osrm website can be found at https://github.com/DennisOSRM/Project-OSRM-Web. -Emil On 02 Mar 2014, at 11:47 , Mishal Chowdhury mishal_chowdh...@icloud.com wrote: I am beginner to Open Street Maps. I want to know, How to create directions/routes from one marker to another marker on a map. IDE used Microsoft Visual Studio 2012 ,ASP.NET Thank you ___ 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
[OSRM-talk] Need help understanding the json responses
Hi, I'm parsing the json responses and the is going well, but my question is more related what is all this stuff? :) Most of it makes sense, but I'm a little confused by the following: The instructions indicate road names: N20, N60, N2, N61, N28, So the is on the arrive at destination maneuver, but not sure what the rationale for not having a name there. The route summary otherwise states the start point and end point names correctly as N20, N28 How is route_name determined? The wiki page states Array of strings giving the name of roads. There does not appear to be an alternative_names item so this must be unique to the route regardless of alternatives? What are the via_points? How are they determined? These appear to be the mapped locations for the start and end points like if I called nearest?loc=lat,lon Is the position field in the instructions an index into a point in the route geometry array? BTW, thanks for putting up with all my questions, this is all starting to come together. Great job all around! Thanks -Steve GET 'http://imaptools.com:5000/viaroute?instructions=truealt=truez=18loc=43.235198,-76.420898loc=43.709579,-76.286316' {version: 0.3, status:0, status_message: Found route between points, route_geometry: {|zmqA`qjwpC?wyP?o{qBl{qB??m{qBm{qB?o{qB?m{qB?o{qB?m{qB?o{qB?m{qB?o{qB?m{qB??ufN, route_instructions: [ [10,N20,5506,0,2915,5506m,E,90], [3,N60,6542,2,562,6542m,S,180], [7,N2,4771,3,146,4771m,E,90], [7,N61,58884,4,1797,58884m,N,0], [3,N28,627,13,153,627m,E,90], [15,,0,14,0,,N,0.0]], route_summary:{ total_distance:76332, total_time:4676, start_point:N20, end_point:N28 }, alternative_geometries: [], alternative_instructions:[], alternative_summaries:[], route_name:[N60,N61], alternative_names:[[,]], via_points:[[43.235294,-76.420897 ],[43.705882,-76.286315 ]], hint_data: { checksum:52824373, locations: [Dw0AAA4AAADwOAAAdgoAAJqulHdeCOs_3reTAt_ocfs, MRIAABYAAADkBgAAES0AAEeiWVys-sA_GuaaApX2c_s] }, transactionId: OSRM Routing Engine JSON Descriptor (v0.3) } ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk