I am wondering how to insert a point into an exiting routing the right way. And if there are ways Graphhopper can already handle that. Most likely using the route-optimization api?
So my question it. I have Point A and B and the route Graphhopper provided to get from A to B. Now my user wants to add an other point and I would like not to stupidly append it to the end, but insert it, where it “belongs”. So if the tap of my user would be somewhere in-between, I’d like the new point to be in-between A and B. And if my user taps somewhere further away, it should e.g. append it to the end or insert it as a new start. So do that smarter.
I am mainly fetching for the buzzword to google for. Is it the route-optimization that would do that? Or is it something else? And would there be an option to keep some of my sort-order in place and just insert the newest point accordingly?
Have a great day and thanks!
Yes, this is done in the web UI. There is nothing like this on the server side and I don’t think that would be useful or even possible, because the server side has no knowledge of previous requests. So there is no previous route one could insert another point into. Or maybe I do not understand what you are trying to do.
Ok… and this code also takes start and end as given, right? So even when I set a point past the end, it will insert it before the end.
It’s a great starting point though! Thanks a lot!
You don’t know how e.g. Komoot is doing it? Their algorithm seems to be able to handle those situations.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.