GraphHopper.com | Forum | GitHub | Maps | Blog

Round trip not working


#1

Hello there,

I’m trying to use the round_trip algorithm, but it’s not working.
My interface looks like Graphhopper’s, meaning the two inputs are still here. If I use both of them, I get the error ‘For round trip calculation exactly onepoint is required’ which is correct and logical.

So I’m not using them, I’m sending the following request in the URL :
/?point=Brest&locale=fr&vehicle=bike&weighting=fastest&algorithm=round_trip&round_trip.seed=0&round_trip.distance=50&elevation=true&use_miles=false&layer=OpenStreetMap

I also tried with coordinates instead of the town :
/?point=48.42954226957197,-4.513578414916993&locale=fr&vehicle=bike&weighting=fastest&algorithm=round_trip&round_trip.seed=0&round_trip.distance=50&elevation=true&use_miles=false&layer=OpenStreetMap

As a result : I only see the starting point pin but nothing else… No path, no errors on the UI, neither on the server status and the console.
So I’m wondering if I need to implement something else to make it work.
Can you please enlighten me ?

Thanks in advance !


#2

Hi,

when sending a request to your server, you definitely need to use coordinates.

Did you check what your server replies if you send the request to the server instead of through the UI.

like localhost:8989/route?point=48.42954226957197,-4.513578414916993&locale=fr&vehicle=bike&weighting=fastest&algorithm=round_trip&round_trip.seed=0&round_trip.distance=50&elevation=true. You need to replace localhost with the address of your server.

There has to be some reply and you should see something in the server logs. This might be an error or a successfully calculated route. If it’s calculated successfully, you might need to expand your UI to support roundtrips.

Unfortunately we cannot guess whats going wrong without seeing any server logs, server replies, or reproducible errors.

Cheers,
Robin


#3

Hello again

May I ask you how to make a request on the server instead of through the ui ?

Also, I did not find any .log or error files, are there any ?
I can possibly log the GHresponse inside the web console though…

I used your url inside the navigator, which gave me a .json uploaded with the answer.
export.json (1.5 KB)

Thank you very much for your time.


#4

Here is the response I see on the server when I send your request on my navigator :

2018-05-15 10:49:09,710 [qtp751021317-96] INFO com.graphhopper.http.GHBaseServlet- point=48.42954226957197,-4.513578414916993&locale=fr&vehicle=bike&weighting=fastest&algorithm=round_trip&round_trip.seed=0&round_trip.distance=50&elevation=true 172.17.3.0 fr Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 [48.42954226957197,-4.513578414916993], took:0.07304755, round_trip, fastest, bike, alternatives: 1, distance0: 582.8530402875426, time0: 2min, points0: 23, debugInfo: idLookup:0.001901128s; tmode:NODE_BASED; , simplify (37->37)


#5

Yes this is the way to do this. The response looks correct to me. So you need to extend your UI to handle round trip responses :slight_smile: .