public abstract static class MapboxMapMatching.Builder
extends java.lang.Object
coordinates(List)
accumulate values.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract MapboxMapMatching.Builder |
accessToken(java.lang.String accessToken)
Required to call when this is being built.
|
MapboxMapMatching.Builder |
addApproaches(java.lang.String... approaches)
Optionally used to indicate how map matched routes consider
rom which side of the road to approach a waypoint.
|
MapboxMapMatching.Builder |
addIgnore(java.lang.String... ignore)
Ignore certain routing restrictions when map matching.
|
MapboxMapMatching.Builder |
addWaypointNames(java.lang.String... waypointNames)
Custom names for waypoints used for the arrival instruction,
each separated by ; .
|
MapboxMapMatching.Builder |
annotations(java.lang.String... annotations)
Whether or not to return additional metadata along the route.
|
protected abstract MapboxMapMatching.Builder |
annotations(java.lang.String annotations) |
protected abstract MapboxMapMatching |
autoBuild() |
abstract MapboxMapMatching.Builder |
bannerInstructions(java.lang.Boolean bannerInstructions)
Setting this will determine whether or not to return banner objects associated with
the `routeSteps`.
|
abstract MapboxMapMatching.Builder |
baseUrl(java.lang.String baseUrl)
Optionally change the APIs base URL to something other then the default Mapbox one.
|
MapboxMapMatching |
build()
This uses the provided parameters set using the
MapboxMapMatching.Builder and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new MapboxMapMatching object with the values provided. |
abstract MapboxMapMatching.Builder |
clientAppName(java.lang.String clientAppName)
Base package name or other simple string identifier.
|
MapboxMapMatching.Builder |
coordinate(com.mapbox.geojson.Point coordinate)
This will add a single
Point to the coordinate list which is used to determine the
duration between points. |
MapboxMapMatching.Builder |
coordinates(java.util.List<com.mapbox.geojson.Point> coordinates)
Add a list of
Point 's which define the points to perform the map matching on. |
protected abstract MapboxMapMatching.Builder |
coordinates(java.lang.String coordinates) |
abstract MapboxMapMatching.Builder |
geometries(java.lang.String geometries)
alter the default geometry being returned for the map matching route.
|
MapboxMapMatching.Builder |
get()
Use GET method to request data.
|
MapboxMapMatching.Builder |
language(java.util.Locale language)
Set the instruction language for the map matching request, the default is english.
|
abstract MapboxMapMatching.Builder |
language(java.lang.String language)
Set the instruction language for the map matching request, the default is english.
|
abstract MapboxMapMatching.Builder |
overview(java.lang.String overview)
Type of returned overview geometry.
|
MapboxMapMatching.Builder |
post()
Use POST method to request data.
|
abstract MapboxMapMatching.Builder |
profile(java.lang.String profile)
This selects which mode of transportation the user will be using to accurately give the
map matching route.
|
MapboxMapMatching.Builder |
radiuses(java.lang.Double... radiuses)
Optionally, set the maximum distance in meters that each coordinate is allowed to move when
snapped to a nearby road segment.
|
abstract MapboxMapMatching.Builder |
roundaboutExits(java.lang.Boolean roundaboutExits)
Setting can be set to either true or false to enable or disable respectively.
|
abstract MapboxMapMatching.Builder |
steps(java.lang.Boolean steps)
Setting this will determine whether to return steps and turn-by-turn instructions.
|
abstract MapboxMapMatching.Builder |
tidy(java.lang.Boolean tidy)
Whether or not to transparently remove clusters and re-sample traces for improved map
matching results.
|
MapboxMapMatching.Builder |
timestamps(java.lang.String... timestamps)
Timestamps corresponding to each coordinate provided in the request; must be numbers in Unix
time (seconds since the Unix epoch) converted to a String.
|
protected abstract MapboxMapMatching.Builder |
timestamps(java.lang.String timestamps) |
abstract MapboxMapMatching.Builder |
user(java.lang.String user)
The username for the account that the directions engine runs on.
|
abstract MapboxMapMatching.Builder |
voiceInstructions(java.lang.Boolean voiceInstructions)
Setting can be set to either true or false to enable or disable SSML marked-up text for
voice guidance along the route.
|
abstract MapboxMapMatching.Builder |
voiceUnits(java.lang.String voiceUnits)
Specify what unit you'd like voice and banner instructions to use.
|
MapboxMapMatching.Builder |
waypointIndices(java.lang.Integer... waypointIndices)
Optionally, set which input coordinates should be treated as waypoints / separate legs.
|
MapboxMapMatching.Builder |
waypoints(java.lang.Integer... waypoints)
Deprecated.
you should now use
waypointIndices(Integer[]) |
@NonNull public MapboxMapMatching.Builder post()
@NonNull public MapboxMapMatching.Builder get()
@NonNull public abstract MapboxMapMatching.Builder accessToken(@NonNull java.lang.String accessToken)
ServicesException
will be thrown.accessToken
- Mapbox access token, You must have a Mapbox account inorder to use
the Map Matching API@NonNull public abstract MapboxMapMatching.Builder tidy(@Nullable java.lang.Boolean tidy)
tidy
- true if you'd like the API to remove coordinates clustered together, otherwise
false@NonNull public abstract MapboxMapMatching.Builder user(@NonNull java.lang.String user)
DirectionsCriteria.PROFILE_DEFAULT_USER
.user
- a non-null string which will replace the default user used in the map matching
request@NonNull public abstract MapboxMapMatching.Builder profile(@NonNull java.lang.String profile)
profile
- required to be one of the String values found in the DirectionsCriteria.ProfileCriteria
@NonNull public abstract MapboxMapMatching.Builder geometries(@NonNull java.lang.String geometries)
DirectionsCriteria.GEOMETRY_POLYLINE6
.
Note that while the API supports GeoJson as an option for geometry, this SDK intentionally removes this as an option since an encoded string for the geometry significantly reduces bandwidth on mobile devices and speeds up response time.
geometries
- null if you'd like the default geometry, else one of the options found in
DirectionsCriteria.GeometriesCriteria
.@NonNull public MapboxMapMatching.Builder radiuses(@Nullable java.lang.Double... radiuses)
Double.POSITIVE_INFINITY
.
If no routable road is found within the radius, a NoSegment
error is returned.
radiuses
- double array containing the radiuses defined in unit meters.@Deprecated @NonNull public MapboxMapMatching.Builder waypoints(@Nullable java.lang.Integer... waypoints)
waypointIndices(Integer[])
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index separated by ; .
MapboxMapMatching.steps()
waypoints
- integer array of coordinate indices to be used as waypoints@NonNull public MapboxMapMatching.Builder waypointIndices(@Nullable java.lang.Integer... waypointIndices)
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index separated by ; .
MapboxMapMatching.steps()
waypointIndices
- integer array of coordinate indices to be used as waypoints@NonNull public abstract MapboxMapMatching.Builder steps(@Nullable java.lang.Boolean steps)
If `steps` is set to `true`, the following guidance-related parameters will be available: `banner_instructions`, `language`, `roundabout_exits`, `voice_instructions`, `voice_units`, `waypoint_names`, and `waypoints`.
steps
- true if you'd like step information@NonNull public abstract MapboxMapMatching.Builder overview(@Nullable java.lang.String overview)
DirectionsCriteria.OVERVIEW_FULL
(the most
detailed geometry available), DirectionsCriteria.OVERVIEW_SIMPLIFIED
(a simplified
version of the full geometry), or DirectionsCriteria.OVERVIEW_FALSE
(no overview
geometry). The default is simplified. Passing in null will use the APIs default setting for
the overview field.overview
- null or one of the options found in DirectionsCriteria.OverviewCriteria
@NonNull public abstract MapboxMapMatching.Builder bannerInstructions(@Nullable java.lang.Boolean bannerInstructions)
Must be used in conjunction with `steps=true`.
bannerInstructions
- true if you'd like step information@NonNull public abstract MapboxMapMatching.Builder voiceInstructions(@Nullable java.lang.Boolean voiceInstructions)
Must be used in conjunction with `steps=true`.
voiceInstructions
- true if you'd like step information@NonNull public abstract MapboxMapMatching.Builder voiceUnits(@Nullable java.lang.String voiceUnits)
Must be used in conjunction with `steps=true` and `voice_instructions=true`.
voiceUnits
- either Imperial (default) or Metric@NonNull public abstract MapboxMapMatching.Builder roundaboutExits(@Nullable java.lang.Boolean roundaboutExits)
Must be used in conjunction with `steps=true`.
roundaboutExits
- true if you'd like step information@NonNull public MapboxMapMatching.Builder annotations(@Nullable java.lang.String... annotations)
DirectionsCriteria.ANNOTATION_DISTANCE
,
DirectionsCriteria.ANNOTATION_DURATION
,
DirectionsCriteria.ANNOTATION_DURATION
and
DirectionsCriteria.ANNOTATION_CONGESTION
.annotations
- string referencing one of the annotation direction criteria's. The strings
restricted to one or multiple values inside the DirectionsCriteria.AnnotationCriteria
or null which will result in no annotations being used@NonNull protected abstract MapboxMapMatching.Builder annotations(@Nullable java.lang.String annotations)
@NonNull public MapboxMapMatching.Builder timestamps(@Nullable java.lang.String... timestamps)
timestamps
- timestamp corresponding to the coordinate added at the identical index@NonNull protected abstract MapboxMapMatching.Builder timestamps(@Nullable java.lang.String timestamps)
@NonNull public MapboxMapMatching.Builder coordinates(@NonNull java.util.List<com.mapbox.geojson.Point> coordinates)
Point
's which define the points to perform the map matching on. The
minimum points is 2 and the maximum points allowed in totals 100. You can use this method in
conjunction with coordinate(Point)
.coordinates
- a List full of Point
s which define the points to perform the map
matching on@NonNull protected abstract MapboxMapMatching.Builder coordinates(@NonNull java.lang.String coordinates)
@NonNull public MapboxMapMatching.Builder coordinate(@NonNull com.mapbox.geojson.Point coordinate)
Point
to the coordinate list which is used to determine the
duration between points. This can be called up to 100 times until you hit the maximum allowed
points. You can use this method in conjunction with coordinates(List)
.coordinate
- a Point
which you'd like the map matching APi to perform on@NonNull public MapboxMapMatching.Builder language(@Nullable java.util.Locale language)
Must be used in conjunction with `steps=true`.
language
- a Locale value representing the language you'd like the instructions to be
written in when returned@NonNull public abstract MapboxMapMatching.Builder language(java.lang.String language)
language
- a String value representing the language you'd like the instructions to be
written in when returned@NonNull public abstract MapboxMapMatching.Builder clientAppName(@NonNull java.lang.String clientAppName)
clientAppName
- base package name or other simple string identifier@NonNull public MapboxMapMatching.Builder addApproaches(@Nullable java.lang.String... approaches)
approaches
- null if you'd like the default approaches,
else one of the options found in
DirectionsCriteria.ApproachesCriteria
.@NonNull public MapboxMapMatching.Builder addWaypointNames(@Nullable java.lang.String... waypointNames)
waypointNames
- Custom names for waypoints used for the arrival instruction.@NonNull public MapboxMapMatching.Builder addIgnore(@Nullable java.lang.String... ignore)
This option is only available for the mapbox/driving profile.
ignore
- routing restrictions@NonNull public abstract MapboxMapMatching.Builder baseUrl(java.lang.String baseUrl)
baseUrl
- base url used as end point@NonNull protected abstract MapboxMapMatching autoBuild()
@NonNull public MapboxMapMatching build()
MapboxMapMatching.Builder
and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new MapboxMapMatching
object with the values provided.com.mapbox.core.exceptions.ServicesException
- when a provided parameter is detected to be incorrect