Package com.graphhopper
Class ResponsePath
java.lang.Object
com.graphhopper.ResponsePath
This class holds the data like points and instructions of a Path.
- Author:
- Peter Karich
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDebugInfo
(String debugInfo) void
addPathDetails
(Map<String, List<PathDetail>> details) Adds the given PathDetails to the existing ones.org.locationtech.jts.geom.Envelope
Calculates the 2D bounding box of this routedouble
This method returns the total elevation change (going upwards) in meter.double
This method returns the total elevation change (going downwards) in meter.double
This method returns the distance of the path.getFare()
getLegs()
int
This method returns all points on the path.double
This method returns a double value which is better than the time for comparison of routes but only if you know what you are doing, e.g.long
getTime()
This method returns the input points snapped to the road network.boolean
boolean
setAscend
(double ascend) setDescend
(double descend) setDescription
(List<String> names) setDistance
(double distance) void
setFare
(BigDecimal fare) void
setImpossible
(boolean impossible) void
setInstructions
(InstructionList instructions) void
setNumChanges
(int numChanges) setPointsOrder
(List<Integer> list) setRouteWeight
(double weight) setTime
(long timeInMillis) setWaypointIndices
(List<Integer> waypointIndices) setWaypoints
(PointList wpList) This method initializes this path with the snapped input points.toString()
-
Constructor Details
-
ResponsePath
public ResponsePath()
-
-
Method Details
-
getDescription
- Returns:
- the description of this route alternative to make it meaningful for the user e.g. it displays one or two main roads of the route.
-
setDescription
-
addDebugInfo
-
getDebugInfo
-
setPointsOrder
-
getPointsOrder
-
getPoints
This method returns all points on the path. Keep in mind that calculating the distance from these points might yield different results compared to getDistance as points could have been simplified on import or after querying. -
setPoints
-
getWaypoints
This method returns the input points snapped to the road network. -
setWaypoints
This method initializes this path with the snapped input points. -
getWaypointIndices
-
setWaypointIndices
-
getDistance
public double getDistance()This method returns the distance of the path. Always prefer this method over getPoints().calcDistance- Returns:
- distance in meter
-
setDistance
-
getAscend
public double getAscend()This method returns the total elevation change (going upwards) in meter.- Returns:
- ascend in meter
-
setAscend
-
getDescend
public double getDescend()This method returns the total elevation change (going downwards) in meter.- Returns:
- decline in meter
-
setDescend
-
getTime
public long getTime()- Returns:
- time in millis
-
setTime
-
getRouteWeight
public double getRouteWeight()This method returns a double value which is better than the time for comparison of routes but only if you know what you are doing, e.g. only to compare routes gained with the same query parameters like vehicle. -
setRouteWeight
-
calcBBox2D
public org.locationtech.jts.geom.Envelope calcBBox2D()Calculates the 2D bounding box of this route -
toString
-
getInstructions
-
setInstructions
-
addPathDetails
Adds the given PathDetails to the existing ones. If there are already PathDetails set, the number details has to be equal todetails
.- Parameters:
details
- The PathDetails to add
-
getPathDetails
-
hasErrors
public boolean hasErrors()- Returns:
- true if this alternative response contains one or more errors
-
getErrors
-
addError
-
addErrors
-
setNumChanges
public void setNumChanges(int numChanges) -
getNumChanges
public int getNumChanges() -
getLegs
-
setFare
-
getFare
-
isImpossible
public boolean isImpossible() -
setImpossible
public void setImpossible(boolean impossible)
-