Closed malizahid closed 6 years ago
Here is my output
{ "code":"Ok", "waypoints":[ { "waypoint_index":0, "trips_index":0, "hint":"RvAIgPRqDoCeAAAAwAAAAAAAAABzAQAAngAAAMAAAAAAAAAAcwEAAAQAAAAW-2wEYQTfASv5bAQp_d4BAABvBv3TL_8=", "location":[ 74.25103, 31.392865 ], "name":"Defense Road" }, { "waypoint_index":2, "trips_index":0, "hint":"mtcJgCvuD4ATAAAANwAAAAAAAAAAAAAAEwAAADcAAAAAAAAAAAAAAAQAAAAquG0EezfhASm4bQR3N-EBAACvBv3TL_8=", "location":[ 74.299434, 31.537019 ], "name":"" }, { "waypoint_index":1, "trips_index":0, "hint":"gsUAgCiUCIApAQAADwAAAAAAAAAAAAAAKQEAAA8AAAAAAAAAAAAAAAQAAADD6G0EwkDhAcHobQSoQOEBAAAvEf3TL_8=", "location":[ 74.311875, 31.539394 ], "name":"" }, { "waypoint_index":4, "trips_index":0, "hint":"scUAgLPFAIBVAAAAHgAAAAAAAAAAAAAAVQAAAB4AAAAAAAAAAAAAAAQAAAB7n20EODThAZCfbQRzNOEBAAD_Ef3TL_8=", "location":[ 74.293115, 31.536184 ], "name":"Bastami Road" }, { "waypoint_index":3, "trips_index":0, "hint":"L5YIgDPuD4BOAAAAKwAAAAAAAAAAAAAATgAAACsAAAAAAAAAAAAAAAQAAADzsW0ErEDhAeixbQSvQOEBAABfDP3TL_8=", "location":[ 74.297843, 31.539372 ], "name":"Rahmat Ali Road" } ], "trips":[ { "legs":[ { "steps":[
],
"weight":5044.2,
"distance":20530.2,
"summary":"",
"duration":5044.2
},
{
"steps":[
],
"weight":439.8,
"distance":1657.8,
"summary":"",
"duration":439.8
},
{
"steps":[
],
"weight":118,
"distance":468.4,
"summary":"",
"duration":118
},
{
"steps":[
],
"weight":170.8,
"distance":692.4,
"summary":"",
"duration":170.8
},
{
"steps":[
],
"weight":4880.4,
"distance":19958.2,
"summary":"",
"duration":4880.4
}
],
"weight_name":"duration",
"geometry":"mlr~D}cedM}p@oB^cZoRkAqcBk~AFsn@ml@oh@e_HktCetAn^_pAoiAmZ|^mt@kq@oSxWoc@nO}@pMk_@~@uD}H_a@wKsFtGuZbCdEqAjH|^mM`e@tLjIeDpOoHsEfW`UiClFmEjJ`JpG~jA`k@`jBxoA~tBbz@rX~o@jh@xu@v[xN`KmPzCfKljBmTjN~O~NuCjO}`@beAqoAbYrW~x@oAGnNh_@x@OnJpJ~Ev{BjI",
"weight":10653.2,
"distance":43307,
"duration":10653.2
}
] }
@malizahid The /trip
service will specifically re-order your waypoints in order to produce the shortest possible route between all points..
If you want to follow the waypoints in the order you supply, you should use the /route
service.
@danpat Thanks for your quick response . I do understand that the waypoints sequence will be different from my supplied ordered and the result of the waypoint index order would be according to TSP (Travelling Salesman Problem ) algorithm . So let me explain what i did . I used the table matrix and from that i manually applied TSP algorithm from my c# code and i got a sequence (which is somehow close to what i get from google distance api using optimization ) . But the sequence and waypoint index sequence that is generated from trip service is incorrect .
Below 2 tables will provide the summary . One is from Google maps and other one is from OSRM
Total Distance | Total Duration 54.58 KMs | 104.47 MINs
Sno | Name | Distance(KMs) | Duration(Mins) 1 | 2101379 - Al Makkah General Store | 29.05 KM | 50.92 Mn 2 | 2234722 - Sheraz General Store | 0.10 KM | 0.60 Mn 3 | 2031070 - Medicine Medical Store | 1.15 KM | 6.38 Mn 4 | 2137439 - ABDULLAH STORE | 0.39 KM | 2.47 Mn 5 | WareHouse | 23.90 KM | 44.10 Mins
OSRM
Total Distance(KM) : 45.52 Total Duration(Mins) : 186.57
no | Name | Distance | Duration | Summary | Steps 0 | 2137439 - ABDULLAH STORE | 21.78 | 90.21 | Defense Road | 1 | 2031070 - Medicine Medical Store | 0.1 | 0.41 | Shamnagar Road | 2 | 2234722 - Sheraz General Store | 1.15 | 4.58 | Khawaja Fareed Road | 3 | 2101379 - Al Makkah General Store | 0.37 | 1.51 | | 4 | WareHouse | 22.13 | 89.86 | Khawaja Fareed Road |
It's not reasonable to expect identical results when comparing to a different service. Off the top of my head, the following things could be problems:
For optimization problems when you supply fewer than 10 coordinates, OSRM's /trip
plugin uses a brute-force search, so it should return optimal results. Any difference will come down to what data it has to work with.
@danpat . Thanks again for the explanation . I think probably i was not able to explain the issue correctly . Let me explain by an example .
Below is the table and the sequence of which Long & Lat were supplied in the API
Way Point Index Generated from Trip Service
Below is the Table Generated from Trip Service
Table Generated from Table Service
Now the Issue over here is that if you compare the Trip Service distance with Table service distance one by one and if you map the names of the customer from Trip and Table service , it wont match . The customer names from the Trip Service table is generated by looking up names from first table according to waypoint index order .
Lets take an example of second row in Trip Service which is "Asim Store" and its distance is 2002.4 . If you look at Asim Store in Table service its distance is 2980.5 . I am not sure if i missing something or if this is the correct way to verify .
Please help .
I have a question about working with osrmTrip.
I run a localhost in my computer for osrm. But I can calculate the osrmTable for 553 coordinate points using the osrm-routed --max-table-size=100000000 map.xml.osrm
But when I tried usint the osrmTrip
function I get this response The OSRM server returned an error: Error: TooBig Too many trip coordinates
.
How do I remove the restriction here.
When I work with 100 coodinate points, it works fine.
But when I work with anything above 100, even 101, Then I get the error message.
@Anyaoha Try doing osrm-routed --help
- there are several different parameters you can set - there's a different one for the /trip
plugin.
@danpat I think it managed to work. Thanks for your help. You have indeed been helpful.
I am currently working to dynamize route for certain locations so that's the reason I want to get the normal plots to visualize before trying to find another package that will help dynamize the route.
Hello ,
First of all i would like to thank the entire osrm community for such an amazing utility . I have done a local installation of OSRM and trying to use Trip Service . When i try to create a sequence of customers that needs to be visited from Waypoint indexes , its coming all wrong . Can someone guide if its a bug or I am missing something ? I used the same waypoints on google direction service and i am getting the correct result . Interestingly when i look at leg distance and duration it makes sense to me .
This is my rest api http://192.168.30.212:5000/trip/v1/driving/74.250539,31.391017;74.299433,31.5370146666667;74.3118733333334,31.5393675;74.293136,31.5362431666667;74.2978316666667,31.5393746666667?source=first&roundtrip=true
Please help.
Thanks, ALi