类 RouteOptions
- 所有已实现的接口:
Serializable
For example, if I request a driving (profile) with alternatives and continueStraight set to true. I make the request but loose reference and information which built the original request. Thus, If I only want to change a single variable such as the destination coordinate, i'd have to have all the other route information stores so the request was made identical to the previous but only now using this new destination point.
Using this class can provide you wth the information used when the DirectionsRoute was
made.
- 另请参阅:
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract StringA valid Nbmap access token used to making the request.abstract BooleanWhether to try to return alternative routes (true) or not (false, default).abstract StringA comma-separated list of annotations.A list of annotations.abstract StringIndicates from which side of the road to approach a waypoint.Indicates from which side of the road to approach a waypoint.abstract BooleanWhether to return banner objects associated with the route steps (true) or not (false, default).abstract StringbaseUrl()The same base URL which was used during the request that resulted in this root directions response.abstract Stringbearings()Influences the direction in which a route starts from a waypoint.Influences the direction in which a route starts from a waypoint.static RouteOptions.Builderbuilder()Build a new instance of this RouteOptions class optionally settling values.abstract BooleanThe allowed direction of travel when departing intermediate waypoints.abstract List<ai.nextbillion.kits.geojson.Point>A list of Points to visit in order.abstract Stringexclude()Exclude certain road types from routing.static RouteOptionsCreate a new instance of this class by passing in a formatted valid JSON String.abstract StringThe format of the returned geometry.abstract Stringlanguage()The language of returned turn-by-turn text instructions.abstract Stringoverview()Displays the requested type of overview geometry.abstract Stringprofile()The routing profile to use.abstract Stringradiuses()The maximum distance a coordinate can be moved to snap to the road network in meters.The maximum distance a coordinate can be moved to snap to the road network in meters.abstract StringA universally unique identifier (UUID) for identifying and executing a similar specific route in the future.abstract BooleanWhether to emit instructions at roundabout exits (true) or not (false, default).abstract StringA semicolon-separated list of booleans affecting snapping of waypoint locations to road segments.A list of booleans affecting snapping of waypoint locations to road segments.abstract Booleansteps()Whether to return steps and turn-by-turn instructions (true) or not (false, default).abstract RouteOptions.BuilderConvert the currentRouteOptionsto its builder holding the currently assigned values.static com.google.gson.TypeAdapter<RouteOptions>typeAdapter(com.google.gson.Gson gson) Gson type adapter for parsing Gson to this class.abstract Stringuser()The same user which was used during the request that resulted in this root directions response.abstract BooleanWhether to return SSML marked-up text for voice guidance along the route (true) or not (false, default).abstract StringA type of units to return in the text for voice instructions.abstract WalkingOptionsTo be used to specify settings for use with the walking profile.abstract StringIndicates which input coordinates should be treated as waypoints.Indicates which input coordinates should be treated as waypoints.abstract StringA semicolon-separated list of custom names for entries in the list ofcoordinates(), used for the arrival instruction in banners and voice instructions.A semicolon-separated list of custom names for entries in the list ofcoordinates(), used for the arrival instruction in banners and voice instructions.abstract StringA semicolon-separated list of coordinate pairs used to specify drop-off locations that are distinct from the locations specified in coordinates.List<ai.nextbillion.kits.geojson.Point>A list of points used to specify drop-off locations that are distinct from the locations specified in coordinates.从类继承的方法 ai.nextbillion.kits.directions.models.DirectionsJsonObject
toJson
-
构造器详细资料
-
RouteOptions
public RouteOptions()
-
-
方法详细资料
-
builder
Build a new instance of this RouteOptions class optionally settling values. -
baseUrl
The same base URL which was used during the request that resulted in this root directions response.- 返回:
- string value representing the base URL
-
user
The same user which was used during the request that resulted in this root directions response.- 返回:
- string value representing the user
-
profile
The routing profile to use. Possible values areDirectionsCriteria.PROFILE_DRIVING_TRAFFIC,DirectionsCriteria.PROFILE_DRIVING,DirectionsCriteria.PROFILE_WALKING, orDirectionsCriteria.PROFILE_CYCLING. The same profile which was used during the request that resulted in this root directions response. NbmapDirections.Builder ensures that a profile is always set even if the NbmapDirections requesting object doesn't specifically set a profile.- 返回:
- string value representing the profile defined in
DirectionsCriteria.ProfileCriteria
-
coordinates
A list of Points to visit in order. There can be between two and 25 coordinates for most requests, or up to three coordinates forDirectionsCriteria.PROFILE_DRIVING_TRAFFICrequests. Note that these coordinates are different than the direction responsesDirectionsWaypoints that these are the non-snapped coordinates.- 返回:
- a list of
Points which represent the route origin, destination, and optionally, waypoints
-
alternatives
Whether to try to return alternative routes (true) or not (false, default). An alternative route is a route that is significantly different than the fastest route, but also still reasonably fast. Such a route does not exist in all circumstances. Up to two alternatives may be returned. This is available forDirectionsCriteria.PROFILE_DRIVING_TRAFFIC,DirectionsCriteria.PROFILE_DRIVING,DirectionsCriteria.PROFILE_CYCLING.- 返回:
- boolean object representing the setting for alternatives
-
language
The language of returned turn-by-turn text instructions. The default is en (English). Must be used in conjunction withRouteOptions.Builder.steps(Boolean).- 返回:
- the language as a string used during the request, if english, this will most likely be empty
-
radiuses
The maximum distance a coordinate can be moved to snap to the road network in meters. There must be as many radiuses as there are coordinates in the request, each separated by ;. Values can be any number greater than 0, the string unlimited or empty string.- 返回:
- a string representing the radiuses separated by ;.
-
radiusesList
The maximum distance a coordinate can be moved to snap to the road network in meters. There must be as many radiuses as there are coordinates in the request. Values can be any number greater than 0, the string unlimited, or null.- 返回:
- a list of radiuses
-
bearings
Influences the direction in which a route starts from a waypoint. Used to filter the road segment the waypoint will be placed on by direction. This is useful for making sure the new routes of rerouted vehicles continue traveling in their current direction. A request that does this would provide bearing and radius values for the first waypoint and leave the remaining values empty. Returns two comma-separated values per waypoint: an angle clockwise from true north between 0 and 360, and the range of degrees by which the angle can deviate (recommended value is 45° or 90°), formatted as {angle, degrees}. If provided, the list of bearings must be the same length as the list of coordinates.- 返回:
- a string representing the bearings with the ; separator. Angle and degrees for every bearing value are comma-separated.
-
bearingsList
Influences the direction in which a route starts from a waypoint. Used to filter the road segment the waypoint will be placed on by direction. This is useful for making sure the new routes of rerouted vehicles continue traveling in their current direction. A request that does this would provide bearing and radius values for the first waypoint and leave the remaining values empty. Returns a list of values, each value is a list of an angle clockwise from true north between 0 and 360, and the range of degrees by which the angle can deviate (recommended value is 45° or 90°). If provided, the list of bearings must be the same length as the list of coordinates.- 返回:
- a List of list of doubles representing the bearings used in the original request. The first value in the list is the angle, the second one is the degrees.
-
continueStraight
The allowed direction of travel when departing intermediate waypoints. If true, the route will continue in the same direction of travel. If false, the route may continue in the opposite direction of travel. Defaults to true forDirectionsCriteria.PROFILE_DRIVINGand false forDirectionsCriteria.PROFILE_WALKINGandDirectionsCriteria.PROFILE_CYCLING.- 返回:
- a boolean value representing whether or not continueStraight was enabled or not during the initial request
-
roundaboutExits
Whether to emit instructions at roundabout exits (true) or not (false, default). Without this parameter, roundabout maneuvers are given as a single instruction that includes both entering and exiting the roundabout. With roundabout_exits=true, this maneuver becomes two instructions, one for entering the roundabout and one for exiting it. Must be used in conjunction withsteps()=true.- 返回:
- a boolean value representing whether or not roundaboutExits was enabled or disabled during the initial route request
-
geometries
The format of the returned geometry. Allowed values are:DirectionsCriteria.GEOMETRY_POLYLINE(default, a polyline with a precision of five decimal places),DirectionsCriteria.GEOMETRY_POLYLINE6(a polyline with a precision of six decimal places).- 返回:
- String geometry type from
DirectionsCriteria.GeometriesCriteria.
-
overview
Displays the requested type of overview geometry. Can beDirectionsCriteria.OVERVIEW_FULL(the most detailed geometry available),DirectionsCriteria.OVERVIEW_SIMPLIFIED(default, a simplified version of the full geometry), orDirectionsCriteria.OVERVIEW_FALSE(no overview geometry).- 返回:
- null or one of the options found in
DirectionsCriteria.OverviewCriteria
-
steps
Whether to return steps and turn-by-turn instructions (true) or not (false, default). If steps is set to true, the following guidance-related parameters will be available:bannerInstructions(),language(),roundaboutExits(),voiceInstructions(),voiceUnits(),waypointNamesList(),waypointTargetsList(), waypoints fromcoordinates()- 返回:
- true if you'd like step information, false otherwise
-
annotations
A comma-separated list of annotations. Defines whether to return additional metadata along the route. Possible values are:DirectionsCriteria.ANNOTATION_DURATIONDirectionsCriteria.ANNOTATION_DISTANCEDirectionsCriteria.ANNOTATION_SPEEDDirectionsCriteria.ANNOTATION_CONGESTIONDirectionsCriteria.ANNOTATION_MAXSPEEDSee theRouteLegobject for more details on what is included with annotations. Must be used in conjunction with overview=full.- 返回:
- a string containing any of the annotations that were used during the request
-
annotationsList
A list of annotations. Defines whether to return additional metadata along the route. Possible values are:DirectionsCriteria.ANNOTATION_DURATIONDirectionsCriteria.ANNOTATION_DISTANCEDirectionsCriteria.ANNOTATION_SPEEDDirectionsCriteria.ANNOTATION_CONGESTIONDirectionsCriteria.ANNOTATION_MAXSPEEDSee theRouteLegobject for more details on what is included with annotations. Must be used in conjunction with overview=full.- 返回:
- a list of annotations that were used during the request
-
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:DirectionsCriteria.PROFILE_DRIVING: One ofDirectionsCriteria.EXCLUDE_TOLL,DirectionsCriteria.EXCLUDE_MOTORWAY, orDirectionsCriteria.EXCLUDE_FERRY.DirectionsCriteria.PROFILE_DRIVING_TRAFFIC: One ofDirectionsCriteria.EXCLUDE_TOLL,DirectionsCriteria.EXCLUDE_MOTORWAY, orDirectionsCriteria.EXCLUDE_FERRY.DirectionsCriteria.PROFILE_WALKING: No excludes supportedDirectionsCriteria.PROFILE_CYCLING:DirectionsCriteria.EXCLUDE_FERRY- 返回:
- a string matching one of the
DirectionsCriteria.ExcludeCriteriaexclusions
-
voiceInstructions
Whether to return SSML marked-up text for voice guidance along the route (true) or not (false, default). Must be used in conjunction withsteps()=true.- 返回:
- true if the original request included voice instructions
-
bannerInstructions
Whether to return banner objects associated with the route steps (true) or not (false, default). Must be used in conjunction withsteps()=true- 返回:
- true if the original request included banner instructions
-
voiceUnits
A type of units to return in the text for voice instructions. Can beDirectionsCriteria.IMPERIAL(default) orDirectionsCriteria.METRIC. Must be used in conjunction withsteps()=true andvoiceInstructions()()}=true.- 返回:
- a string matching either imperial or metric
-
accessToken
A valid Nbmap access token used to making the request.- 返回:
- a string representing the Nbmap access token
-
requestUuid
A universally unique identifier (UUID) for identifying and executing a similar specific route in the future. NbmapDirections always waits for the response object which ensures this value will never be null.- 返回:
- a string containing the request UUID
-
approaches
Indicates from which side of the road to approach a waypoint. AcceptsDirectionsCriteria.APPROACH_UNRESTRICTED(default) orDirectionsCriteria.APPROACH_CURB. If set toDirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints from either side of the road. If set toDirectionsCriteria.APPROACH_CURB, the route will be returned so that on arrival, the waypoint will be found on the side that corresponds with the driving_side of the region in which the returned route is located. If provided, the list of approaches must be the same length as the list of waypoints.- 返回:
- a string representing approaches for each waypoint
-
approachesList
Indicates from which side of the road to approach a waypoint. AcceptsDirectionsCriteria.APPROACH_UNRESTRICTED(default) orDirectionsCriteria.APPROACH_CURB. If set toDirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints from either side of the road. If set toDirectionsCriteria.APPROACH_CURB, the route will be returned so that on arrival, the waypoint will be found on the side that corresponds with the driving_side of the region in which the returned route is located. If provided, the list of approaches must be the same length as the list of waypoints.- 返回:
- a list of strings representing approaches for each waypoint
-
waypointIndices
Indicates which input coordinates should be treated as waypoints.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 ; .
steps()- 返回:
- a string representing indices to be used as waypoints
-
waypointIndicesList
Indicates which input coordinates should be treated as waypoints.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.
steps()- 返回:
- a List of Integers representing indices to be used as waypoints
-
waypointNames
A semicolon-separated list of custom names for entries in the list ofcoordinates(), used for the arrival instruction in banners and voice instructions. Values can be any string, and the total number of all characters cannot exceed 500. If provided, the list of waypoint_names must be the same length as the list of coordinates. The first value in the list corresponds to the route origin, not the first destination. Must be used in conjunction withsteps()= true.- 返回:
- a string representing names for each waypoint
-
waypointNamesList
A semicolon-separated list of custom names for entries in the list ofcoordinates(), used for the arrival instruction in banners and voice instructions. Values can be any string, and the total number of all characters cannot exceed 500. If provided, the list of waypoint_names must be the same length as the list of coordinates. The first value in the list corresponds to the route origin, not the first destination. Must be used in conjunction withsteps()= true.- 返回:
- a list of strings representing names for each waypoint
-
waypointTargets
A semicolon-separated list of coordinate pairs used to specify drop-off locations that are distinct from the locations specified in coordinates. If this parameter is provided, the Directions API will compute the side of the street, left or right, for each target based on the waypoint_targets and the driving direction. The maneuver.modifier, banner and voice instructions will be updated with the computed side of street. The number of waypoint targets must be the same as the number of coordinates. Must be used withsteps()= true.- 返回:
- a list of Points representing coordinate pairs for drop-off locations
-
waypointTargetsList
A list of points used to specify drop-off locations that are distinct from the locations specified in coordinates. If this parameter is provided, the Directions API will compute the side of the street, left or right, for each target based on the waypoint_targets and the driving direction. The maneuver.modifier, banner and voice instructions will be updated with the computed side of street. The number of waypoint targets must be the same as the number of coordinates. Must be used withsteps()= true.- 返回:
- a list of Points representing coordinate pairs for drop-off locations
-
walkingOptions
To be used to specify settings for use with the walking profile.- 返回:
- options to use for walking profile
-
snappingClosures
A semicolon-separated list of booleans affecting snapping of waypoint locations to road segments. If true, road segments closed due to live-traffic closures will be considered for snapping. If false, they will not be considered for snapping. If provided, the number of snappingClosures must be the same as the number of coordinates. Must be used withDirectionsCriteria.PROFILE_DRIVING_TRAFFIC- 返回:
- a String representing a list of booleans
-
snappingClosuresList
A list of booleans affecting snapping of waypoint locations to road segments. If true, road segments closed due to live-traffic closures will be considered for snapping. If false, they will not be considered for snapping. If provided, the number of snappingClosures must be the same as the number of coordinates. Must be used withDirectionsCriteria.PROFILE_DRIVING_TRAFFIC- 返回:
- a list of booleans
-
typeAdapter
Gson type adapter for parsing Gson to this class.- 参数:
gson- the builtGsonobject- 返回:
- the type adapter for this class
-
fromJson
Create a new instance of this class by passing in a formatted valid JSON String.- 参数:
json- a formatted valid JSON string defining a RouteOptions- 返回:
- a new instance of this class defined by the values passed inside this static factory method
-
toBuilder
Convert the currentRouteOptionsto its builder holding the currently assigned values. This allows you to modify a single property and then rebuild the object resulting in an updated and modifiedRouteOptions.- 返回:
- a
RouteOptions.Builderwith the same values set to match the ones defined in thisRouteOptions
-