Package com.massifmaps.routing
Class RoutingResult
java.lang.Object
com.massifmaps.routing.RoutingResult
A class that defines list of routing actions and path geometry.
-
Constructor Summary
ConstructorsConstructorDescriptionRoutingResult(Projection projection, MapPosVector points, RoutingInstructionVector instructions, String rawResult) Constructs a new RoutingResult instance from projection, points and instructions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this object is equal to the specified object.intReturns the number of turn-by-turn instructions.Returns the turn-by-turn instruction list.Returns every turn-by-turn instruction as one JSON array.
A maneuver is nine scalars, and reading them one instruction at a time costs a call per
field: a mountain route has hundreds.intReturns the number of points in the path.Returns the point list of the result.Returns the projection of the points in the result.Returns raw resultdoubleReturns the total distance of the path.doubleReturns the approximate total duration of the path.inthashCode()Returns the hash value of this object.toString()Creates a string representation of this result object, useful for logging.
-
Constructor Details
-
RoutingResult
public RoutingResult(Projection projection, MapPosVector points, RoutingInstructionVector instructions, String rawResult) Constructs a new RoutingResult instance from projection, points and instructions.- Parameters:
projection- The projection of the routing result (same as the request).points- The point list defining the routing path. Instructions refer to this list.instructions- The turn-by-turn instruction list.
-
-
Method Details
-
equals
Checks if this object is equal to the specified object. -
hashCode
public int hashCode()Returns the hash value of this object. -
getProjection
Returns the projection of the points in the result.- Returns:
- The projection of the result.
-
getPoints
Returns the point list of the result. The list contains all the points the route must pass in correct order.- Returns:
- The point list of the path.
-
getInstructions
Returns the turn-by-turn instruction list.- Returns:
- The turn-by-turn instruction list.
-
getInstructionCount
public int getInstructionCount()Returns the number of turn-by-turn instructions.- Returns:
- The number of instructions in the list.
-
getInstructionsJSON
Returns every turn-by-turn instruction as one JSON array.
A maneuver is nine scalars, and reading them one instruction at a time costs a call per
field: a mountain route has hundreds. The keys are the property names
(`action`, `pointIndex`, `streetName`, `instruction`, `turnAngle`, `azimuth`,
`distance`, `time`), and `action` is the enum's constant name.- Returns:
- The instruction list as JSON.
-
getPointCount
public int getPointCount()Returns the number of points in the path.- Returns:
- The number of points in the path.
-
getTotalDistance
public double getTotalDistance()Returns the total distance of the path.- Returns:
- The total distance in meters.
-
getTotalTime
public double getTotalTime()Returns the approximate total duration of the path.- Returns:
- The total duration in seconds.
-
getRawResult
Returns raw result -
toString
Creates a string representation of this result object, useful for logging.
-