-
Notifications
You must be signed in to change notification settings - Fork 117
Expose include-hov/hot parameters and add exclude list option #1296
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
Conversation
| public static final String EXCLUDE_RESTRICTED = "restricted"; | ||
|
|
||
| /** | ||
| * TBD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktatterso could you share the docs?
| public static final String INCLUDE_HOV2 = "hov2"; | ||
|
|
||
| /** | ||
| * TBD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktatterso could you share the docs?
| * Include certain road types from routing. The default is to not include anything from the | ||
| * profile selected. The following include flags are available for each profile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktatterso is this accurate? If not, could you share the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Include certain road types from routing. The default is to not include anything from the | |
| * profile selected. The following include flags are available for each profile: | |
| * Include certain road types in routing. By default, none of the road types listed below are included. The following include flags are available for each profile: |
| public static final String INCLUDE_HOV3 = "hov3"; | ||
|
|
||
| /** | ||
| * TBD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktatterso could you share the docs?
8801bfb to
1e30d13
Compare
|
API support for this feature has landed, we're good to proceed merging this PR and issuing a release. /cc: @browndp08 |
| * Include certain road types from routing. The default is to not include anything from the | ||
| * profile selected. The following include flags are available for each profile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * Include certain road types from routing. The default is to not include anything from the | |
| * profile selected. The following include flags are available for each profile: | |
| * Include certain road types in routing. By default, none of the road types listed below are included. The following include flags are available for each profile: |
| * Include certain road types from routing. The default is to not include anything from the | ||
| * profile selected. The following include flags are available for each profile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
| * @return this builder for chaining options together | ||
| */ | ||
| @NonNull | ||
| public abstract Builder include(@Nullable @DirectionsCriteria.IncludeCriteria String include); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include only one parameter, or can it be a list? If the latter, we should also expose a List method variant and test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to exclude https://github.com/mapbox/mapbox-navigation-android/blob/d1218a77e305e04672754835df5fe22a4a68985a/libnavigation-base/src/main/java/com/mapbox/navigation/base/route/RouteExclusions.kt#L15-L21 should we do implement that for include from the SDK side for consistency? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this should be part of the mapbox-java for both include and exclude, same as all the other list paramaters.
1e30d13 to
9695ba6
Compare
|
Addressed the feedback. This is ready for another round of eyes @mapbox/navigation-android |
abhishek1508
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add some more tests on what happens if we exclude or include some criteria for a profile that is not supported? For ex: a test for what happens if Profile.Walking and you add Include.HOV2
| .exclude(DirectionsCriteria.EXCLUDE_TOLL) | ||
| .excludeList(new ArrayList<String>() {{ | ||
| add(DirectionsCriteria.EXCLUDE_TOLL); | ||
| add(DirectionsCriteria.EXCLUDE_TUNNEL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test uses a DirectionsCriteria.PROFILE_DRIVING_TRAFFIC and excludes TUNNEL, but TUNNEL exclude is not mentioned in the documentation above. If DRIVING and DRIVING_TRAFFIC both support TUNNEL as exclude could you please add it to the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. That being said, Directions team is working on supporting the DRIVING_TRAFFIC profile in the short term mapbox/mapbox-navigation-android#3844 (comment)
In order to be more accurate, I can fix the tests to use DRIVING profile instead 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the feedback, but I meant this:
A list of exclude. Exclude certain road types from routing.
* The default is to not exclude anything from the profile selected.
* The following exclude flags are available for each profile:
* <p>
* {@link DirectionsCriteria#PROFILE_DRIVING}: One of {@link DirectionsCriteria#EXCLUDE_TOLL},
* {@link DirectionsCriteria#EXCLUDE_MOTORWAY}, or {@link DirectionsCriteria#EXCLUDE_FERRY}.
In the test you are using EXCLUDE_TUNNEL for PROFILE_DRIVING, but the documentation does not mention that it is supported. Could you add {@link DirectionsCriteria#EXCLUDE_TUNNEL} to the documenation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to fix the tests and use ferry for example. tunnel is not supported based on https://docs.mapbox.com/api/navigation/directions/
| Profile | Available excludes |
|---|---|
| mapbox/driving | One or more of toll, motorway, ferry, or unpaved |
| mapbox/driving-traffic | One or more of toll, motorway, ferry, or unpaved |
| mapbox/walking | No excludes supported |
| mapbox/cycling | ferry |
Thanks for confirming @danpat
I think those are developer misconfigurations that we shouldn't handle from the client side. We threw exceptions in the past but we decided it wasn't a good idea and let Directions API handle it. Actually if tomorrow Directions API wants to support one more profile we'd need to change it from our side and cut a new release. I'd vote for avoiding that. |
9695ba6 to
a57b1c4
Compare
|
Thanks for the feedback @abhishek1508 I've addressed it so this is ready again for another round of 👀 |
services-directions/src/main/java/com/mapbox/api/directions/v5/DirectionsService.java
Show resolved
Hide resolved
a57b1c4 to
8eb90a9
Compare
|
@kmadsen @abhishek1508 OK ready for a final round of 👀 |
abhishek1508
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the feedback @Guardiola31337
| public abstract String exclude(); | ||
|
|
||
| /** | ||
| * A list of exclude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this is needed. Redundant with the @return and there is already a description
| * A list of exclude. |
| public abstract String include(); | ||
|
|
||
| /** | ||
| * A list of include. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, don't think this is needed.
| * A list of include. |
| public abstract Builder exclude(@Nullable @DirectionsCriteria.ExcludeCriteria String exclude); | ||
|
|
||
| /** | ||
| * A list of exclude. Exclude certain road types from routing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * A list of exclude. Exclude certain road types from routing. | |
| * Exclude certain road types from routing. |
RouteOptions#1293excludelist option Expose include-hov/hot parameters and add exclude list option #1296 (comment)Opening this as a
Draftuntil Directions team deploysincludeparams from their side in production. For now, we can test it in Staging using aSNAPSHOTfrom https://github.com/mapbox/mapbox-navigation-androidcc @browndp08 @ktatterso @kelseylivingston @zugaldia @jill-cardamon