类 DirectionsRoute
java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsJsonObject
ai.nextbillion.kits.directions.models.DirectionsRoute
- 所有已实现的接口:
Serializable
Detailed information about an individual route such as the duration, distance and geometry.
- 另请参阅:
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static DirectionsRoute.Builderbuilder()Create a new instance of this class by using theDirectionsRoute.Builderclass.abstract Doubledistance()The distance traveled from origin to destination.abstract Doubleduration()The estimated travel time from origin to destination.abstract DoubleThe typical travel time from this route's origin to destination.static DirectionsRouteCreate a new instance of this class by passing in a formatted valid JSON String.abstract Stringgeometry()Gives the geometry of the route.legs()A Leg is a route between only two waypoints.abstract StringThe index of this route in the original network response.abstract RouteOptionsHolds onto the parameter information used when making the directions request.abstract DirectionsRoute.BuilderConvert the currentDirectionsRouteto its builder holding the currently assigned values.static com.google.gson.TypeAdapter<DirectionsRoute>typeAdapter(com.google.gson.Gson gson) Gson type adapter for parsing Gson to this class.abstract StringString of the language to be used for voice instructions.abstract Doubleweight()The calculated weight of the route.abstract StringThe name of the weight profile used while calculating during extraction phase.从类继承的方法 ai.nextbillion.kits.directions.models.DirectionsJsonObject
toJson
-
构造器详细资料
-
DirectionsRoute
public DirectionsRoute()
-
-
方法详细资料
-
builder
Create a new instance of this class by using theDirectionsRoute.Builderclass.- 返回:
- this classes
DirectionsRoute.Builderfor creating a new instance
-
routeIndex
The index of this route in the original network response.- 返回:
- string of an int value representing the index
-
distance
The distance traveled from origin to destination.- 返回:
- a double number with unit meters
-
duration
The estimated travel time from origin to destination.- 返回:
- a double number with unit seconds
-
durationTypical
The typical travel time from this route's origin to destination. There's a delay along this route if you subtract this durationTypical() value from the route's duration() value and the resulting difference is greater than 0. The delay is because of any number of real-world situations (road repair, traffic jam, etc).- 返回:
- a double number with unit seconds
-
geometry
Gives the geometry of the route. Commonly used to draw the route on the map view.- 返回:
- an encoded polyline string
-
weight
The calculated weight of the route.- 返回:
- the weight value provided from the API as a
doublevalue
-
weightName
The name of the weight profile used while calculating during extraction phase. The default isroutabilitywhich is duration based, with additional penalties for less desirable maneuvers.- 返回:
- a String representing the weight profile used while calculating the route
-
legs
A Leg is a route between only two waypoints.- 返回:
- list of
RouteLegobjects
-
routeOptions
Holds onto the parameter information used when making the directions request. Useful for re-requesting a directions route using the same information previously used.- 返回:
- a
RouteOptionss object which holds onto critical information from the request that cannot be derived directly from the directions route
-
voiceLanguage
String of the language to be used for voice instructions. Defaults to en, and can be any accepted instruction language. Will be null when the language provided NbmapDirections.Builder#language() via is not compatible with API Voice.- 返回:
- String compatible with voice instructions, null otherwise
-
toBuilder
Convert the currentDirectionsRouteto 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 modifiedDirectionsRoute.- 返回:
- a
DirectionsRoute.Builderwith the same values set to match the ones defined in thisDirectionsRoute
-
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 GeoJson Directions Route- 返回:
- a new instance of this class defined by the values passed inside this static factory method
-