Class Maneuver
Class Maneuver
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.routing.Maneuver
-
public final class Maneuver extends NativeBase
This class provides all the information for a maneuver. The directional information (e.g. road names, road numbers and signpost direction) is stored in
getRoadTexts()andgetNextRoadTexts()attributes. As for the motorway exit information, it can be obtained fromgetExitSignTexts()attribute.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManeuverActiongetAction()Gets the maneuver action.GeoCoordinatesgetCoordinates()Gets the geographic coordinates where the maneuver is located.java.lang.StringgetCountryCode()Gets the country code of the maneuver position.DurationgetDuration()Gets the estimated time in seconds needed to perform the maneuver.LocalizedTextsgetExitSignTexts()Gets the textual attributes of the exit sign.LocalizedTextsgetIntersectionNames()Gets the textual attributes of the intersection.intgetLengthInMeters()Gets the length of the maneuver in meters.RoadTextsgetNextRoadTexts()Gets the textual attributes of the next road containing the corresponding road name(s) and road number(s) after the maneuver point.intgetOffset()Gets the index overSection.getGeometry()where the maneuver is located.RoadTextsgetRoadTexts()Gets the textual attributes of the current road containing road names, road numbers and signpost direction (towards) information.java.lang.DoublegetRoundaboutAngleInDegrees()The angle is estimated between the incoming and outgoing route parts before entering the actual roundabout.intgetSectionIndex()Gets the index overRoute.getSections()indicating the section to which the maneuver belongs to.SignpostgetSignpost()GetsSignpostobject.intgetSpanIndex()Gets the index overSection.getSpans()indicating the first span after the maneuver point.java.lang.StringgetText()Gets the maneuver instruction.java.lang.DoublegetTurnAngleInDegrees()Gets the angle of the turn component of the maneuver.
-
-
-
Method Detail
-
getAction
@NonNull public ManeuverAction getAction()
Gets the maneuver action.
- Returns:
Indicates the maneuver action.
-
getCoordinates
@NonNull public GeoCoordinates getCoordinates()
Gets the geographic coordinates where the maneuver is located.
- Returns:
Geographic coordinates where the maneuver is located.
-
getOffset
public int getOffset()
Gets the index over
Section.getGeometry()where the maneuver is located.- Returns:
Index over
Section.getGeometry()where the maneuver is located.
-
getCountryCode
@Nullable public java.lang.String getCountryCode()
Gets the country code of the maneuver position. The value is
nullwhen no data is available.- Returns:
The country code of the maneuver position. The value is
nullwhen no data is available.
-
getExitSignTexts
@NonNull public LocalizedTexts getExitSignTexts()
Gets the textual attributes of the exit sign. These might contain exit number(s) and/or name(s).
These attributes are only provided for the Navigate Edition. Otherwise, the attributes are always empty.
- Returns:
The textual attributes of the exit sign. These might contain exit number(s) and/or name(s).
-
getLengthInMeters
public int getLengthInMeters()
Gets the length of the maneuver in meters.
- Returns:
The length of the maneuver in meters.
-
getRoadTexts
@NonNull public RoadTexts getRoadTexts()
Gets the textual attributes of the current road containing road names, road numbers and signpost direction (towards) information.
Note: These attributes are only provided for the Navigate Edition. Otherwise, the attributes are always empty.
- Returns:
The textual attributes of the current road containing road names, road numbers and signpost direction (towards) information.
-
getNextRoadTexts
@NonNull public RoadTexts getNextRoadTexts()
Gets the textual attributes of the next road containing the corresponding road name(s) and road number(s) after the maneuver point.
These attributes are only provided for the Navigate Edition. Otherwise, the attributes are always empty.
- Returns:
The textual attributes of the next road containing the corresponding road name(s) and road number(s) after the maneuver point.
-
getSignpost
@Nullable public Signpost getSignpost()
Gets
Signpostobject.- Returns:
Gets the
Signpostobject.
-
getIntersectionNames
@NonNull public LocalizedTexts getIntersectionNames()
Gets the textual attributes of the intersection.
These attributes are only provided for the Navigate Edition. Otherwise, the attributes are always empty. Note: Routes calculated with OfflineRoutingEngine are not supported.
- Returns:
The textual attributes of the intersection.
-
getText
@NonNull public java.lang.String getText()
Gets the maneuver instruction. The text is formatted and localized as specified via
RouteTextOptions.Note for Navigate Edition: This text is meant to be displayed in a preview context, whereas real-time
EventTextListenertexts are meant to be used for spoken voice announcements during a trip.- Returns:
The maneuver instruction. The text is formatted and localized as specified via
RouteTextOptions.
-
getSectionIndex
public int getSectionIndex()
Gets the index over
Route.getSections()indicating the section to which the maneuver belongs to.- Returns:
Index over
Route.getSections()indicating the section to which the maneuver belongs to.
-
getSpanIndex
public int getSpanIndex()
Gets the index over
Section.getSpans()indicating the first span after the maneuver point.Note: The span index for the last maneuvers (those maneuvers with maneuver action set to
ManeuverAction.ARRIVE) cannot be used, since these maneuvers are placed after the last span of the route and the span index for them would be greater than the span list size.- Returns:
Index over
Section.getSpans()indicating the first span after the maneuver point.
-
getDuration
@NonNull public Duration getDuration()
Gets the estimated time in seconds needed to perform the maneuver.
- Returns:
The estimated time in seconds needed to perform the maneuver.
-
getTurnAngleInDegrees
@Nullable public java.lang.Double getTurnAngleInDegrees()
Gets the angle of the turn component of the maneuver. The value is in degrees and from -180 to 180.
The angle increases clockwise and small values are used for going straight, i.e. a positive number means there is a right turn and a negative number is a left turn. Some maneuvers like Depart, Arrive and Roundabout pass doesn't have a well defined angle, so the value is omitted. Note: These attributes are only provided for the Navigate Edition.
- Returns:
The angle of the turn component of the maneuver.
-
getRoundaboutAngleInDegrees
@Nullable public java.lang.Double getRoundaboutAngleInDegrees()
The angle is estimated between the incoming and outgoing route parts before entering the actual roundabout.
This is done to provide a better orientation for drivers. For better results, the incoming and outcoming route parts can be around 50 meters in length. In addition, these parts lie usually around 30 meters away from the actual roundabout. Therefore, the resulting arc does not necessarily represent the exact curved path a vehicle has to follow within a roundabout from the point of entry to the point of exit. Instead, it reflects the route path before and after the roundabout to highlight the directional change along the route. The angle can have a value from -360.0 to 360.0, and it is positive in right-hand side driving country, and negative in left-hand side countries. Note that the value is available for both the enter roundabout actions and the exit roundabout actions. Both maneuvers have the same value. When the incoming or outgoing route parts are curvy or when the roundabout itself is not representing a perfect circle, then the accuracy of the angle may be compromised. Note: These attributes are only provided for the Navigate Edition.
- Returns:
The angle is estimated between the incoming and outgoing route parts before entering the actual roundabout.
-
-