Class Span
Class Span
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.routing.Span
-
public final class Span extends NativeBase
A span is a part of the
Sectionwhich is traversable or navigable. Each span usually has some geometry associated with it.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DurationgetBaseDuration()Gets the time duration necessary to traverse the span, using the speed provided ingetDynamicSpeedInfo()without taking into consideration the delays caused by the traffic.java.util.List<AccessAttributes>getCarAttributes()The list of car access attributes on the span.java.lang.DoublegetConsumptionInKilowattHours()Gets the power consumption in kilowatt per hour necessary to traverse the span.java.lang.StringgetCountryCode()Gets the country code of the span.DurationgetDuration()Gets the time duration necessary to traverse the span, using the speed provided ingetDynamicSpeedInfo().DynamicSpeedInfogetDynamicSpeedInfo()The dynamic speed information on the span.FunctionalRoadClassgetFunctionalRoadClass()Gets the functional road class of the span.GeoPolylinegetGeometry()Gets theGeoPolylineobject representing the polyline of this span.intgetLengthInMeters()Gets the length of this span in meters.java.util.List<java.lang.Integer>getNoThroughRestrictionsIndexes()Get the list of indexes toSection.getNoThroughRestrictions()the parent section owns.java.util.List<java.lang.Integer>getNoticeIndexes()Gets the list of indexes toSection.getSectionNotices()the parent section owns.LocalizedRoadNumbersgetRoadNumbers()Gets the road numbers on the span enriched with information specific to route numbers of a road such as I-10, US-50, or A3, and cardinal direction, if available, and a road level classification (RouteType).java.util.List<AccessAttributes>getScooterAttributes()The list of scooter access attributes on the span.intgetSectionPolylineOffset()Gets the position of the span inside the section's geometry, given as an offset.SegmentReferencegetSegmentReference()Gets the segment reference of this span.java.lang.StringgetShieldText(LocalizedRoadNumber roadNumber)Converts full route number to the value to be displayed on the road shield.java.lang.DoublegetSpeedLimitInMetersPerSecond()Gets the speed limit in meters per second on the span.java.lang.StringgetStateCode()Gets the state code of the span.java.util.List<StreetAttributes>getStreetAttributes()The list of street attributes on the span.LocalizedTextsgetStreetNames()The street names on the span.java.util.List<java.lang.Integer>getTrafficIncidentIndexes()The indexes of traffic incidents from the fieldSection.getTrafficIncidents()of the parentSection.java.util.List<AccessAttributes>getTruckAttributes()The list of truck access attributes on the span.java.util.List<WalkAttributes>getWalkAttributes()The list of walk attributes on the span.
-
-
-
Method Detail
-
getShieldText
@NonNull public java.lang.String getShieldText(@NonNull LocalizedRoadNumber roadNumber)Converts full route number to the value to be displayed on the road shield. The results are based on country code and state code of
Spanobject and route type of passedroad_numberargument.- Parameters:
roadNumber-Route number to convert to shield text.
- Returns:
Text on the road shield to display.
-
getGeometry
@NonNull public GeoPolyline getGeometry()
Gets the
GeoPolylineobject representing the polyline of this span.- Returns:
The
GeoPolylineobject representing the polyline of this span.
-
getLengthInMeters
public int getLengthInMeters()
Gets the length of this span in meters.
- Returns:
The length of this span in meters.
-
getNoticeIndexes
@NonNull public java.util.List<java.lang.Integer> getNoticeIndexes()
Gets the list of indexes to
Section.getSectionNotices()the parent section owns. In case the list is not empty, the user must judge all the indexedSectionNotice's carefully before proceeding.- Returns:
The list of indexes to
Section.getSectionNotices()the parent section owns. In case the list is not empty, the user must judge all the indexedSectionNotices carefully before proceeding.
-
getSegmentReference
@NonNull public SegmentReference getSegmentReference()
Gets the segment reference of this span.
- Returns:
The segment reference of this span.
-
getTrafficIncidentIndexes
@NonNull public java.util.List<java.lang.Integer> getTrafficIncidentIndexes()
The indexes of traffic incidents from the field
Section.getTrafficIncidents()of the parentSection. Each matching incident takes at least a wholegetGeometry(). The same incident can take other spans and an area out of the built route as well.- Returns:
The indexes of traffic incidents from the field
Section.getTrafficIncidents()of the parentSection. Each matching incident takes at least a wholegetGeometry(). The same incident can take other spans and an area out of the built route as well.
-
getSectionPolylineOffset
public int getSectionPolylineOffset()
Gets the position of the span inside the section's geometry, given as an offset. The span geometry starts from this offset and ends on the offset of the next span, both start offset point and end offset point being included in the span, because the spans' geometry share a point in the section's geometry.
- Returns:
The position of the span inside the section's geometry, given as an offset. The span geometry starts from this offset and ends on the offset of the next span, both start offset point and end offset point being included in the span, because the spans' geometry share a point in the section's geometry.
-
getDynamicSpeedInfo
@Nullable public DynamicSpeedInfo getDynamicSpeedInfo()
The dynamic speed information on the span.
- Returns:
The dynamic speed information on the span.
-
getStreetAttributes
@NonNull public java.util.List<StreetAttributes> getStreetAttributes()
The list of street attributes on the span.
- Returns:
The list of street attributes on the span.
-
getCarAttributes
@NonNull public java.util.List<AccessAttributes> getCarAttributes()
The list of car access attributes on the span.
- Returns:
The list of car access attributes on the span.
-
getTruckAttributes
@NonNull public java.util.List<AccessAttributes> getTruckAttributes()
The list of truck access attributes on the span.
- Returns:
The list of truck access attributes on the span.
-
getScooterAttributes
@NonNull public java.util.List<AccessAttributes> getScooterAttributes()
The list of scooter access attributes on the span.
- Returns:
The list of scooter access attributes on the span.
-
getWalkAttributes
@NonNull public java.util.List<WalkAttributes> getWalkAttributes()
The list of walk attributes on the span.
- Returns:
The list of walk attributes on the span.
-
getStreetNames
@NonNull public LocalizedTexts getStreetNames()
The street names on the span.
- Returns:
The street names on the span.
-
getRoadNumbers
@NonNull public LocalizedRoadNumbers getRoadNumbers()
Gets the road numbers on the span enriched with information specific to route numbers of a road such as I-10, US-50, or A3, and cardinal direction, if available, and a road level classification (
RouteType).- Returns:
The road numbers on the span enriched with information specific to route numbers of a road such as I-10, US-50, or A3, and cardinal direction, if available, and a road level classification (
RouteType).
-
getSpeedLimitInMetersPerSecond
@Nullable public java.lang.Double getSpeedLimitInMetersPerSecond()
Gets the speed limit in meters per second on the span.
- Returns:
The speed limit in meters per second on the span.
-
getConsumptionInKilowattHours
@Nullable public java.lang.Double getConsumptionInKilowattHours()
Gets the power consumption in kilowatt per hour necessary to traverse the span.
- Returns:
The power consumption in kilowatt per hour necessary to traverse the span.
-
getFunctionalRoadClass
@Nullable public FunctionalRoadClass getFunctionalRoadClass()
Gets the functional road class of the span.
- Returns:
The functional road class of the span.
-
getDuration
@NonNull public Duration getDuration()
Gets the time duration necessary to traverse the span, using the speed provided in
getDynamicSpeedInfo(). This duration takes also into consideration the delays caused by the traffic.- Returns:
The time duration necessary to traverse the span, using the speed provided in
getDynamicSpeedInfo(). This duration takes also into consideration the delays caused by the traffic.
-
getBaseDuration
@NonNull public Duration getBaseDuration()
Gets the time duration necessary to traverse the span, using the speed provided in
getDynamicSpeedInfo()without taking into consideration the delays caused by the traffic.- Returns:
The time duration necessary to traverse the span, using the speed provided in
getDynamicSpeedInfo()without taking into consideration the delays caused by the traffic.
-
getCountryCode
@Nullable public java.lang.String getCountryCode()
Gets the country code of the span. The value is
nullwhen no data is available.- Returns:
The country code of the span. The value is
nullwhen no data is available.
-
getStateCode
@Nullable public java.lang.String getStateCode()
Gets the state code of the span. State code is available in some countries to denote principal subdivisions(provinces or states), e.g. in the United States, AK stands for Alaska and OH stands for Ohio. The format of state code can vary for different countries, take the United States as example, it consists of two alphabet letters. The value is
nullwhen no data is available.- Returns:
The state code of the span. State code is available in some countries to denote principal subdivisions(provinces or states), e.g. in the United States, AK stands for Alaska and OH stands for Ohio. The format of state code can vary for different countries, take the United States as example, it consists of two alphabet letters. The value is
nullwhen no data is available.
-
getNoThroughRestrictionsIndexes
@NonNull public java.util.List<java.lang.Integer> getNoThroughRestrictionsIndexes()
Get the list of indexes to
Section.getNoThroughRestrictions()the parent section owns. In case the list is not empty, the user must judge all the indexedSection.getNoThroughRestrictions()'s carefully before proceeding.- Returns:
The list of indexes to
Section.getNoThroughRestrictions()the parent section owns. In case the list is not empty, the user must judge all the indexed sdk routing noThroughRestriction's carefully before proceeding.
-
-