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 new 'profile' parameter to select routing profile #1859
Comments
One note about the
Hmmh, yeah. We need some algorithm-dependent way to check this. For LM it is not only about the simple cases, e.g. increasing the weight should work in general, like "avoid highway/ferry/steps/...". But I think this can be done via a CustomWeighting with the
Yes, I would throw an error if someone tries to change the "base vehicle" of a server-side CustomModel.
I don't think it is important to have this also via URL parameter. Via POST request is sufficient and then we use the same configuration that is used for the CH profiles (via yaml)?
I do not see a use case for that and would avoid this (throw an error). So that you can only specify the |
Ok but as long as we do have flag encoders how are we supposed to distinguish e.g. car|fastest from foot|fastest? If you just want to get rid of the vehicle parameter do you mean to include the vehicle in the weighting name instead, i.e. I'd like to come back to this issue and your other points when #493 becomes more clear. |
Yes, exactly. But probably the EncodedValue-collection can still be used as "vehicle", so not that important, we should just think about that the vehicle is currently a FlagEncoder and will likely be a EncodedValuesCollection. |
Ok, sure. So basically some EncodedValuesCollections will need a name too ;) |
Update: In the meantime we have decided to always require the profile parameter (for For backward-compatibility we add a converter on the web-api level (
So far we were also using some rules like
For some of these rules the converter will need to be aware of the existing configuration... I am also wondering if we need to keep all these rules or if we can get rid of some (rarely used) ones Any preferences here? I think I would prefer the option that is easier to understand... |
Maybe one important difference is that the first approach allows 'configuring' the converter, for example we could name a profile with |
In #493 its discussed how to specify CH profiles and part of this question is how they can be selected for incoming routing requests (especially when adding custom weightings in #1776). There are multiple cases that have to be differentiated. These are the current options that can be used on each routing request and affect the profile that will be used:
The speed-ups can only be used if a matching profile exists on the server side, but how should this profile be selected? So far we are doing it like this:
FlagEncoder
and create the correspondingWeighting
In the future this will be more complicated, because the weighting will be configurable: There will be
CustomWeighting
in #1776, but also we might add the option to use theShortFastestWeighting
with an additional distance factor, a more advanced turn cost configuration or even blocked areas. In any case we can no longer require specifying all the properties of these weightings to select the profile on the server side (or at least its very unclear to me how this is supposed to work. How can we check if a requested and an available profile are 'equal' and would it not be very cumbersome to send the entire profile configuration with every request?). Instead, we will select these profiles by a unique name. To do this we will add aprofile
parameter to the routing endpoint. The question that arises is how this relates to the other parameters, because they will then be redundant and possibly conflicting. At the same time we do not want to break backwards compatibility, so for the current use-cases it should still be possible to choose the vehicle&weighting without setting the CH profile name for example.These are the different cases:
No
CustomWeighting
if LM/CH are disabled the
vehicle/weighting/etc
parameters are used to create the weighting, just like we did in the past. theprofile
parameter cannot be used in this case (see below)if LM/CH are enabled and no
profile
is given thevehicle/weighting/turn_costs/u_turn_costs
parameters are used to create a profile name following a certain naming convention, something likegh_car_fastest_edge_30
. The profile is then selected using this profile name. This is equal to the current behavior except the profile name handling on the server sideif LM/CH are enabled and a
profile
is given thevehicle/weighting/etc
parameters are meaningless, because they cannot be considered in addition to the vehicle/weighting etc. defined by the corresponding profile. This is confusing, because setting any of these parameters will not make a difference. Maybe it would be best to throw an error ifprofile
and any of these parameters is set on the request? For LM its a bit different: For example its possible to use a certain LM profile and increase the u_turn_costs, but on the other hand it makes no sense to use an LM profile which uses the "shortest" weighting with the "fastest" weighting. Should we try to allow some of these cases or deny them for simplicity?With
CustomWeighting
The
CustomWeighting
can be defined by specifying aCustomModel
per request, but also there can beCustomModel
s on the server side that can be further adjusted/partly overwritten per request.Whenever a
CustomModel
is sent on the request thevehicle
parameter becomes meaningless, because of thebase
field in theCustomModel
which specifies the vehicle already. Or should it be the other way around? Again, this is confusing and it would be better to throw an error if both these parameters are set on the same request? Similarly, theweighting
parameter becomes meaningless as well, because with aCustomModel
the weighting will always beCustomWeighting
. So far the turn cost configuration only consists of theu_turn_cost
parameter, but if this gets more advanced how should this be configurable via the url parameters?Sending a request with a
profile
parameter and aCustomModel
can be interpreted as using theCustomModel
with this name on the server side and merge this with the givenCustomModel
of the request. But unfortunately this is not possible with CH/LM. The easiest option here seems to be denying requests with CH/LM enabled that specify aprofile
and contain aCustomModel
. Then again for LM this is possible in some cases (but figuring out whether or not this works might require comparing the weight of all edges using the weighting used for preparation and the one specified on the request).The text was updated successfully, but these errors were encountered: