Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add straight line support to routing #497

Merged
merged 47 commits into from
May 12, 2022
Merged

Add straight line support to routing #497

merged 47 commits into from
May 12, 2022

Conversation

nrenner
Copy link
Owner

@nrenner nrenner commented May 12, 2022

Adds client-side support for route segments to be straight lines ("as the crow flies") instead of requesting a route to follow ways. Part of #68.

Restore removed key listeners of super class to avoid duplicate calls (36d8a20)
which makes it more clear that there is no data
- update on beeline toggle
- avoid distance markers wandering accross the map while routing many waypoints, because beelines are added immediately, by turning off updates in-between
for better comparison during development
and ensure profile text is loaded before updating route and straight line stats
@nrenner nrenner merged commit e5ea917 into master May 12, 2022
@nrenner nrenner mentioned this pull request May 12, 2022
5 tasks
@rkflx
Copy link
Contributor

rkflx commented May 12, 2022

Nice work!

(Not sure why you already merged the PR less than 7 minutes after its creation, though. Are you not really interested in reviews or comments, and this is just for the CI checks? Personally, I won't spend too much review effort on this now it is already on master, since you were also asking previously to suspend reviews on the branch. I guess you'll want people to create new issues for minor individual bugs from here on, and consider the overall feature done.)

As for submitting and rebasing the various changes I hinted at before and which were waiting for the branch to merge: This will take me some time, sorry for that (busy currently).

Anyway, now it's time to celebrate one of the most requested features has been merged 🥳 🎉

Thanks!

@bagage
Copy link
Collaborator

bagage commented May 12, 2022

Awesome work @nrenner, congrats for successfully landing that huge feature! And just in time for the summer 🚲 ;)

@nrenner
Copy link
Owner Author

nrenner commented May 13, 2022

Not sure why you already merged the PR less than 7 minutes after its creation, though.

I just wanted to get that out of the way. I personally like GitHub PRs as a nice overview of my larger changes, that might also be helpful for reference later on, instead of just merging, and they also make reviewing easier in case anyone feels like it, even if already merged.

@afischerdev
Copy link

For the new beeline handling I added a new logic to the BRouter lib.
There are two new entries:
for lonlats it is possible to define an optional marker 'd'
"lonlats" = lon,lat,d|...
or use the parameter
&straight=1,2

It enables the transfer of all points to the BRouter lib in one request.
There is still the elevation problem, points outside a way can't have one.

If interested please generate a lib from
https://github.com/afischerdev/brouter/tree/direct-lines

This is tested with the server variante, Android test is needed and will follow.

I have no server to test on - only locally - so I did it with wget.

// web address for the sample
https://bikerouter.de/#map=15/49.9505/8.7105/standard&lonlats=8.708526,49.951697;8.710077,49.951731;8.710656,49.951386;8.710442,49.949756;8.709148,49.94942&straight=1,2&profile=trekking

// use straigth
wget -O result.gpx "localhost:7777/brouter?lonlats=8.708526,49.951697|8.710077,49.951731|8.710442,49.949756|8.709148,49.94942&straight=1&profile=trekking&alternativeidx=0

// use direct markter
wget -O result.gpx "localhost:7777/brouter?lonlats=8.708526,49.951697|8.710077,49.951731,d|8.710442,49.949756|8.709148,49.94942&profile=trekking&alternativeidx=0

// use an extra off point
wget -O result.gpx "localhost:7777/brouter?lonlats=8.708526,49.951697|8.710077,49.951731|8.710656,49.951386|8.710442,49.949756|8.709148,49.94942&straight=1,2&profile=trekking&alternativeidx=0

// start point is in the off
wget -O result.gpx "localhost:7777/brouter?lonlats=8.710656,49.951386|8.710442,49.949756|8.709148,49.94942&straight=0&profile=trekking&alternativeidx=0

// end point is in the off - needs two markers at the last two points
wget -O result.gpx "localhost:7777/brouter?lonlats=8.708526,49.951697|8.710077,49.951731|8.710656,49.951386&straight=1,2&profile=trekking&alternativeidx=0

@afischerdev
Copy link

Android works as well with the
"lonlats" = lon,lat,d|...
variante.

@nrenner
Copy link
Owner Author

nrenner commented Jul 13, 2022

As for submitting and rebasing the various changes I hinted at before and which were waiting for the branch to merge: This will take me some time, sorry for that (busy currently).

@rkflx Could you please list what those are, so we don't do duplicate work? E.g. #404 could be addressed now.

@nrenner nrenner deleted the 68-sl-routing branch July 18, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants