-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Require a radius
parameter other than unlimited
when using bearings
#2983
Comments
radius
parameter other then unlimited
when using bearings
radius
parameter other than unlimited
when using bearings
I guess in most cases when the segment with a matching bearing is too far away, the range of the bearing is probably too strict/narrow/small. Currently, we also do not recommend any value that should be used as a bearing range in osrm. We should at least recommend some range that makes sense in the osrm documentation (is per chat with @TheMarex:
I like option 1 as it makes things easier but I don't know if there are many use cases where people would want to set specific ranges. Otherwise having a |
I don't have a strong opinion on the syntax changes proposed here; libraries such as MapboxDirections.swift rationalize away any syntactic problems anyways. Rather, I think most of the confusion stems from bearing falling into an uncanny valley that's just different enough from the expected behavior, but coupling with a radius seems to address that. |
I'd like to take a crack at this if this issue is still open and available. |
Currently every plugin will search the whole StaticRTree until a matching bearing segment is found - no matter how far away it is. For a lot of users this is an unexpected result and can have serious performance implications (even on accident).
Hence to make the user aware that it actually only makes sense to search in a specific search radius, say 100m when using the bearings filter, we should enforce this on the API level.
This means in case of no segment with the given bearing value in the search radius we will return
NoSegment
which is a better indicator then just returning a coordinate potentially across the Atlantic.Two options for implementing this:
bearings
without settingradius
will error (invalid request)bearings
implies thatradius=SOME_DEFAULT_VALUE
I would prefer option 1 because it makes it more explicit that we changed the behavior.
The text was updated successfully, but these errors were encountered: