HERE Android SDK Developer's Guide

Route

The class Route is a member of com.here.android.mpa.routing .

Class Summary

public final class Route

extends java.lang.Object

Represents a distinct path connecting two or more waypoints GeoCoordinate .

[For complete information, see the section Class Details]

See also:

RouteResult

RouteManager

Nested Class Summary

Table 1. Nested Classes in Route
Nested Classes

public static final enumeration Route.TrafficPenaltyMode

Enumeration for calculating route duration.

Field Summary

Table 2. Fields in Route
Fields

public static final int WHOLE_ROUTE

Method Summary

Table 3. Methods in Route
Methods

public GeoBoundingBox getBoundingBox ()

Gets the smallest GeoBoundingBox that contains the entire route.

public GeoCoordinate getDestination ()

Gets the destination coordinate for the route.

public Maneuver getFirstManeuver ()

Returns the first Maneuver.

public int getLength ()

Gets the length of the route, in meters.

public java.util.List <Maneuver> getManeuvers ()

Gets the list of all maneuvers that travelers will encounter along the route.

public RouteElements getRouteElements ()

public RouteElements getRouteElements (Maneuver maneuver)

Gets the RouteElements belonging to this Maneuver.

public RouteElements getRouteElementsFromDuration (long duration)

Gets the RouteElements for a given duration (in seconds) from the start of the route.

public RouteElements getRouteElementsFromDuration (long start, long duration)

Gets the RouteElements for a given duration (in seconds) within the route.

public RouteElements getRouteElementsFromLength (int length)

Gets the RouteElements for a given distance (in meters) within the route.

public RouteElements getRouteElementsFromLength (int start, int length)

Gets the RouteElements for a given distance (in meters) within the route.

public java.util.List <GeoCoordinate> getRouteGeometry ()

Gets the list of all GeoCoordinate values representing, in order, the polyline of the route.

public RoutePlan getRoutePlan ()

Returns the route plan for defining a route with one or more route legs.

public GeoCoordinate getStart ()

Gets the starting coordinate for the route.

public int getSublegCount ()

Returns the number of sub-legs the route has.

public RouteTta getTta (TrafficPenaltyMode mode, int subleg)

Gets the estimated time to arrival with current traffic conditions.

public java.util.List <GeoCoordinate> getWaypoints ()

Gets the list of all waypoints for the route.

Class Details

Represents a distinct path connecting two or more waypoints GeoCoordinate . A Route consists of a list of maneuvers and route links.

See also:

RouteResult

RouteManager

Field Details

public static final int WHOLE_ROUTE

Method Details

public GeoBoundingBox getBoundingBox ()

Gets the smallest GeoBoundingBox that contains the entire route.

Returns:

The GeoBoundingBox

public GeoCoordinate getDestination ()

Gets the destination coordinate for the route.

Returns:

The destination GeoCoordinate

public Maneuver getFirstManeuver ()

Returns the first Maneuver.

Returns:

the first Maneuver, null if there are no maneuvers

public int getLength ()

Gets the length of the route, in meters.

Returns:

The route length in meters

public java.util.List <Maneuver> getManeuvers ()

Gets the list of all maneuvers that travelers will encounter along the route.

Returns:

The list of Maneuver objects

public RouteElements getRouteElements ()

public RouteElements getRouteElements (Maneuver maneuver)

Gets the RouteElements belonging to this Maneuver.

Parameters:

  • maneuver

    The Maneuver to get the RouteElements for.

Returns:

The RouteElements belonging to this Maneuver.

public RouteElements getRouteElementsFromDuration (long duration)

Gets the RouteElements for a given duration (in seconds) from the start of the route.

Parameters:

  • duration

    The number of seconds from the beginning of the route.

Returns:

The RouteElements within the given duration.

public RouteElements getRouteElementsFromDuration (long start, long duration)

Gets the RouteElements for a given duration (in seconds) within the route.

Parameters:

  • start

    The number of seconds into the route to start getting RouteElements.

  • duration

    The number of seconds from the given start of the route.

Returns:

The RouteElements within the given duration.

public RouteElements getRouteElementsFromLength (int length)

Gets the RouteElements for a given distance (in meters) within the route.

Parameters:

  • length

    The number of meters from the beginning of the route.

Returns:

The RouteElements within the given distance.

public RouteElements getRouteElementsFromLength (int start, int length)

Gets the RouteElements for a given distance (in meters) within the route.

Parameters:

  • start

    The number of meters into the route to start getting RouteElements.

  • length

    The number of meters from the start parameter within this route.

Returns:

The RouteElements within the given distance.

public java.util.List <GeoCoordinate> getRouteGeometry ()

Gets the list of all GeoCoordinate values representing, in order, the polyline of the route.

Returns:

A list of GeoCoordinate values

See also:

MapPolyline

public RoutePlan getRoutePlan ()

Returns the route plan for defining a route with one or more route legs. Route legs are formed by a list of stop overs in the route plan. Each route leg has it's own route options.

Returns:

RoutePlan

public GeoCoordinate getStart ()

Gets the starting coordinate for the route.

Returns:

The starting GeoCoordinate

public int getSublegCount ()

Returns the number of sub-legs the route has. A sub leg is the part of a route between two stop waypoints

Returns:

number of sublegs

public RouteTta getTta (TrafficPenaltyMode mode, int subleg)

Gets the estimated time to arrival with current traffic conditions. If traffic is to be used, the caller is recommended to obtain a traffic update for the route first (and wait for it to complete) to populate the traffic database.

This method requires the Traffic Enabled Car Routing permission in order to be used when mode is OPTIMAL. Please contact a HERE customer representative to acquire this permission.

Parameters:

Returns:

The RouteTta of the subleg.

Throws:

  • IllegalArgumentException

    If mode is AVOID_CONGESTION.

  • IllegalArgumentException

    If subleg is smaller than zero or greater or equal to getSublegCount().

  • AccessControlException

    If the required permission is missing.

public java.util.List <GeoCoordinate> getWaypoints ()

Gets the list of all waypoints for the route.

Returns:

The list of GeoCoordinate objects

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.