HERE Android SDK Developer's Guide

RoadElement

The class RoadElement is a member of com.here.android.mpa.common .

Class Summary

public final class RoadElement

extends java.lang.Object

Represents a single segment of a road.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in RoadElement
Nested Classes

public static final enumeration RoadElement.Attribute

Defined values for different road attributes

public static final enumeration RoadElement.FormOfWay

Form of Way Types

public static final enumeration RoadElement.PluralType

Plural type identifies when a Junction is made up of multiple Road Elements.

Method Summary

Table 2. Methods in RoadElement
Methods

public boolean equals (Object other)

For documentation, see java.lang.Object

public java.util.EnumSet <Attribute> getAttributes ()

Gets the road attributes.

public float getDefaultSpeed ()

Gets the default speed of the road element.

public FormOfWay getFormOfWay ()

Gets the form of way.

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

Returns the geometry of the road element.

public double getGeometryLength ()

Returns the length of the polyline associated with this RoadElement in meters.

public Identifier getIdentifier ()

Get the Identifier for this particular RoadElement.

public int getNumberOfLanes ()

Gets number of lanes in this road element.

public long getPermanentDirectedLinkId ()

The Permanent Link ID (stable across different map versions) of the RoadElement with travel direction: positive sign (+) means driving in the 'canonical' direction of the road and negative sign (-) means driving against the 'canonical' direction of the road.

public long getPermanentLinkId ()

Returns the Permanent Link ID (stable across different map versions) of the RoadElement .

public PluralType getPluralType ()

Gets the plural type of the road element.

public static RoadElement getRoadElement (GeoCoordinate coordinate, String marcCode)

Get the RoadElement of the current GeoCoordinate .

public static java.util.List <RoadElement> getRoadElements (GeoBoundingBox boundingBox, String marcCode)

Get the list of RoadElement of the current GeoBoundingBox .

public String getRoadName ()

Gets the name of the road element.

public String getRouteName ()

Gets the route name of the road element.

public float getSpeedLimit ()

Gets the speed limit.

public Date getStartTime ()

Gets the (estimated) time at which this road element starts.

public float getStaticSpeed ()

Gets the static speed of the road element using only free-flow speeds.

public int hashCode ()

For documentation, see java.lang.Object

public boolean isPedestrian ()

Checks, if the road is allowed only for pedestrians.

public boolean isPlural ()

Tests if the road element is plural.

Class Details

Represents a single segment of a road.

Method Details

public boolean equals (Object other)

For documentation, see java.lang.Object

Parameters:

  • other

public java.util.EnumSet <Attribute> getAttributes ()

Gets the road attributes.

Returns:

Set of RoadElement.Attribute

public float getDefaultSpeed ()

Gets the default speed of the road element. It uses the same speeds used during routing, includes dynamic events, for example, if traffic is enabled.

Returns:

The default speed in m/s or 0.0 if the information is not available.

public FormOfWay getFormOfWay ()

Gets the form of way.

Returns:

The form of way of the road.

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

Returns the geometry of the road element. The geometry is a returned as a list of GeoCoordinate that can be used to create a polyline.

Returns:

a list of GeoCoordinate

public double getGeometryLength ()

Returns the length of the polyline associated with this RoadElement in meters.

Returns:

length of polyline for this RoadElement in meters.

public Identifier getIdentifier ()

Get the Identifier for this particular RoadElement.

Returns:

Identifier

public int getNumberOfLanes ()

Gets number of lanes in this road element.

Returns:

The number of lanes in this road element.

public long getPermanentDirectedLinkId ()

The Permanent Link ID (stable across different map versions) of the RoadElement with travel direction: positive sign (+) means driving in the 'canonical' direction of the road and negative sign (-) means driving against the 'canonical' direction of the road. Every road element has two endpoints. Starting from which end point the link is being traversed? Each link has a geometry associated with it. The geometry gives the link a 'canonical' direction: if you traverse the link in the direction the geometry is stored, you are traveling in the positive direction. Otherwise, you are traveling in the negative direction. The assigned 'canonical' direction is completely arbitrary and no assumption should be made about it. This property is unavailable when the public transport mode RouteOptions.TransportMode#PUBLIC_TRANSPORT is used. For all the other transport modes, it is available only in routes calculated with the online connectivity mode.

Returns:

Permanent Link ID with direction of this element or 0 if not available.

See also:

getPermanentLinkId()

public long getPermanentLinkId ()

Returns the Permanent Link ID (stable across different map versions) of the RoadElement . This property is unavailable when the public transport mode RouteOptions.TransportMode#PUBLIC_TRANSPORT is used. For all the other transport modes, it is available only in routes calculated with the online connectivity mode.

Returns:

Permanent Link ID of this element or 0 if not available.

See also:

getPermanentDirectedLinkId()

public PluralType getPluralType ()

Gets the plural type of the road element.

Returns:

The plural type of the road element.

public static RoadElement getRoadElement (GeoCoordinate coordinate, String marcCode)

Get the RoadElement of the current GeoCoordinate . This method returns null if the GeoCoordinate is invalid or there is no RoadElement close enough to the GeoCoordinate .

Parameters:

  • coordinate

    The GeoCoordinate that defines the coordinate to retrieve RoadElement

  • marcCode

    The text for RoadElement corresponds to the language MARC code.

Returns:

The RoadElement of the current GeoCoordinate.

Throws:

  • IllegalArgumentException

    If coordinate is null, marcCode is null or marcCode is an empty string.

public static java.util.List <RoadElement> getRoadElements (GeoBoundingBox boundingBox, String marcCode)

Get the list of RoadElement of the current GeoBoundingBox .

Parameters:

  • boundingBox

    The GeoBoundingBox that defines the area to retrieve RoadElement

  • marcCode

    The text for RoadElement corresponds to the language MARC code.

Returns:

The list of RoadElement of the current GeoBoundingBox.

public String getRoadName ()

Gets the name of the road element. The method returns a null string if the name is unknown.

Returns:

The name of the road.

public String getRouteName ()

Gets the route name of the road element. The route name is a short label for the road, for example I5 for the Interstate 5 in the US. The method returns a null string if the route name is unknown.

Returns:

The route name of the road element.

public float getSpeedLimit ()

Gets the speed limit.

Returns:

The speed limit in m/s or 0 if the information is not available.

public Date getStartTime ()

Gets the (estimated) time at which this road element starts. If no departure time was set for the RouteOptions associated with this road element, 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 start time, or null if not available

See also:

setTime(Date, TimeType)

public float getStaticSpeed ()

Gets the static speed of the road element using only free-flow speeds. It does not include dynamic events, for example, excludes traffic even if enabled.

Returns:

The static speed in m/s or 0.0 if the information is not available.

public int hashCode ()

For documentation, see java.lang.Object

public boolean isPedestrian ()

Checks, if the road is allowed only for pedestrians.

Returns:

True, if road is allowed only for pedestrians, otherwise false.

public boolean isPlural ()

Tests if the road element is plural.

Returns:

True if the road element is plural.

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.