HERE Android SDK Developer's Guide

TransitRouteElement

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

Class Summary

public final class TransitRouteElement

extends java.lang.Object

Represents an element within a transit-specific Route.

[For complete information, see the section Class Details]

See also:

Route

getTransitElement()

getTransitRouteElements()

Method Summary

Table 1. Methods in TransitRouteElement
Methods

public TransitRouteStop getArrivalStop ()

Gets the arrival station.

public Date getArrivalTime ()

Gets time of arrival at the station for the TransitRouteElement.

public TransitRouteStop getDepartureStop ()

Gets the departure station.

public Date getDepartureTime ()

Gets the time of departure from the station for the TransitRouteElement.

public String getDestination ()

Gets the destination name for the TransitRouteElement.

public int getDuration ()

Gets the total duration.

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

Gets the geometry of the TransitRouteElement.

public Identifier getId ()

Returns the transit route element identifier.

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

Gets the geometry of only the line part of the TransitRouteElement, excluding any positions of entrances.

public String getLineName ()

Gets the line name for the TransitRouteElement.

public TransitLineStyle getLineStyle ()

Gets the TransitManeuver.TransitLineStyle that is typical of the way in which TransitRouteElement lines are drawn on maps of the local operator.

public int getPrimaryLineColor ()

Gets the primary color of the TransitRouteElement in the local public transit operator's color scheme.

public int getSecondaryLineColor ()

Gets the secondary color of the TransitRouteElement in the local public transit operator's color scheme.

public Image getSystemAccessLogo ()

Gets the transit system access logo if available, otherwise returns an invalid image.

public String getSystemInformalName ()

Gets the informal name of the system operating the TransitRouteElement.

public Image getSystemLogo ()

Gets the transit system logo if available, otherwise returns an invalid image.

public String getSystemOfficialName ()

Gets the name of the system operating the TransitRouteElement.

public String getSystemShortName ()

Gets the name, in a shorter or abbreviated version if available, of the system operating the TransitRouteElement.

public TransitType getTransitType ()

Gets the TransitType of the transit system offering service for the TransitRouteElement.

public String getTransitTypeName ()

Gets the transit type of the transit system offering service for the TransitRouteElement, as a String in the transit operator's local vocabulary.

public int getVehicleTravelTime ()

Gets the vehicle travel time.

public boolean hasPrimaryLineColor ()

Returns whether element's primary line color is available.

public boolean hasSecondaryLineColor ()

Returns whether element's secondary line color is available.

Class Details

Represents an element within a transit-specific Route.

See also:

Route

getTransitElement()

getTransitRouteElements()

Method Details

public TransitRouteStop getArrivalStop ()

Gets the arrival station.

Returns:

arrival station

See also:

TransitRouteStop

public Date getArrivalTime ()

Gets time of arrival at the station for the TransitRouteElement.

Note: If no departure time was set for the RouteOptions associated with this TransitRouteElement , than the time is relative to the system time when the route calculation took place. Otherwise, the times are relative to the specified departure time.

Returns:

The arrival time, or null if unavailable

See also:

setTime(Date, TimeType)

public TransitRouteStop getDepartureStop ()

Gets the departure station.

Returns:

departure station

See also:

TransitRouteStop

public Date getDepartureTime ()

Gets the time of departure from the station for the TransitRouteElement.

Note: If no departure time was set for the RouteOptions associated with this TransitRouteElement , than the time is relative to the system time when the route calculation took place. Otherwise, the times are relative to the specified departure time.

Returns:

The departure time, or null if unavailable

See also:

setTime(Date, TimeType)

public String getDestination ()

Gets the destination name for the TransitRouteElement.

Returns:

The destination name

public int getDuration ()

Gets the total duration. Unit is seconds.

Note: when calculating transportation travel times for display to the user, this is generally the value to be used.

Returns:

total duration in seconds

See also:

getVehicleTravelTime()

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

Gets the geometry of the TransitRouteElement. The geometry includes the line part of a TransitRouteElement , plus positions of entrances.

Returns:

A List of GeoCoordinate objects

See also:

getLineGeometry()

public Identifier getId ()

Returns the transit route element identifier. TransitRouteElement. The id can be used to highlight the transit line on a transit route.

Returns:

the unique object identifier.

See also:

highlightTransitLines(List<Identifier>)

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

Gets the geometry of only the line part of the TransitRouteElement, excluding any positions of entrances.

Returns:

A List of GeoCoordinate objects

See also:

getGeometry()

public String getLineName ()

Gets the line name for the TransitRouteElement.

Returns:

The line name

public TransitLineStyle getLineStyle ()

Gets the TransitManeuver.TransitLineStyle that is typical of the way in which TransitRouteElement lines are drawn on maps of the local operator.

Returns:

The TransitLineStyle

public int getPrimaryLineColor ()

Gets the primary color of the TransitRouteElement in the local public transit operator's color scheme.

Returns:

The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255] with 0 meaning no contribution for that component, and 255 meaning 100% contribution

See also:

getPrimaryLineColor()

public int getSecondaryLineColor ()

Gets the secondary color of the TransitRouteElement in the local public transit operator's color scheme.

Returns:

The ARGB integer color value. The packed integer is made up of 4 bytes: alpha, red, green, blue. Each color component has a value range from [0..255] with 0 meaning no contribution for that component, and 255 meaning 100% contribution

See also:

getSecondaryLineColor()

public Image getSystemAccessLogo ()

Gets the transit system access logo if available, otherwise returns an invalid image.

Returns:

An Image representing the transit system access logo

See also:

getSystemLogo()

public String getSystemInformalName ()

Gets the informal name of the system operating the TransitRouteElement. if available

Returns:

The informal transit system name, e.g. "SMGN".

See also:

getSystemInformalName()

public Image getSystemLogo ()

Gets the transit system logo if available, otherwise returns an invalid image.

Returns:

An Image, including letters next to it, representing the transit system logo

See also:

getSystemAccessLogo()

public String getSystemOfficialName ()

Gets the name of the system operating the TransitRouteElement.

Returns:

The transit system name

See also:

getSystemOfficialName()

public String getSystemShortName ()

Gets the name, in a shorter or abbreviated version if available, of the system operating the TransitRouteElement.

Returns:

The transit system name in shortened form

See also:

getSystemShortName()

public TransitType getTransitType ()

Gets the TransitType of the transit system offering service for the TransitRouteElement.

Returns:

The TransitType

public String getTransitTypeName ()

Gets the transit type of the transit system offering service for the TransitRouteElement, as a String in the transit operator's local vocabulary.

Returns:

The transit type name

See also:

getTransitType()

public int getVehicleTravelTime ()

Gets the vehicle travel time. Unit is seconds.

Note: Generally, when calculating transportation travel times for display to the user, use the value given by getDuration(void) instead.

Returns:

vehicle travel time in seconds

See also:

getDuration()

public boolean hasPrimaryLineColor ()

Returns whether element's primary line color is available.

Returns:

true if color is available, false - otherwise

public boolean hasSecondaryLineColor ()

Returns whether element's secondary line color is available.

Returns:

true if color is available, false - otherwise

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.