Skip to content

Commit 95377eb

Browse files
DzmitryFomchyngithub-actions[bot]
authored andcommitted
[cherry-pick] freeflow attribute cp (#11436)
* Freeflow attribute (#11309) * Add new edge metadata properties * Changelog * Update changelog * Bump UXF dependencies * Remove changelog GitOrigin-RevId: c730d932085b678a6af9efcd60fa5d85790c3979
1 parent fe59853 commit 95377eb

3 files changed

Lines changed: 37 additions & 21 deletions

File tree

base/api/current.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,9 +1580,11 @@ package com.mapbox.navigation.base.trip.model.eh {
15801580

15811581
public final class EHorizonEdgeMetadata {
15821582
method public boolean getBridge();
1583+
method public Double? getConstrainedFlowSpeed();
15831584
method public String? getCountryCodeIso2();
15841585
method public String? getCountryCodeIso3();
15851586
method public byte getCurvature();
1587+
method public Double? getFreeFlowSpeed();
15861588
method public String getFunctionRoadClass();
15871589
method public double getHeading();
15881590
method public Byte? getLaneCount();
@@ -1601,9 +1603,11 @@ package com.mapbox.navigation.base.trip.model.eh {
16011603
method public boolean isRightHandTraffic();
16021604
method public boolean isUrban();
16031605
property public final boolean bridge;
1606+
property public final Double? constrainedFlowSpeed;
16041607
property public final String? countryCodeIso2;
16051608
property public final String? countryCodeIso3;
16061609
property public final byte curvature;
1610+
property public final Double? freeFlowSpeed;
16071611
property public final String functionRoadClass;
16081612
property public final double heading;
16091613
property public final boolean isOneWay;

base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonEdgeMetadata.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import com.mapbox.navigation.base.road.model.RoadComponent
1818
* @param functionRoadClass the edge's [RoadClass]
1919
* @param speedLimit max speed of the edge (speed limit) in m/s
2020
* @param speed average speed along the edge in m/s
21+
* @param freeFlowSpeed Optional edge's free flow speed (m/s) when there is no traffic
22+
* @param constrainedFlowSpeed Optional edge's constrained flow speed (m/s) when there is traffic
2123
* @param ramp is the edge a ramp?
2224
* @param motorway is the edge a motorway?
2325
* @param bridge is the edge a bridge?
@@ -42,6 +44,8 @@ class EHorizonEdgeMetadata internal constructor(
4244
val functionRoadClass: String,
4345
val speedLimit: Double?,
4446
val speed: Double,
47+
val freeFlowSpeed: Double?,
48+
val constrainedFlowSpeed: Double?,
4549
val ramp: Boolean,
4650
val motorway: Boolean,
4751
val bridge: Boolean,
@@ -74,6 +78,8 @@ class EHorizonEdgeMetadata internal constructor(
7478
if (functionRoadClass != other.functionRoadClass) return false
7579
if (speedLimit != other.speedLimit) return false
7680
if (speed != other.speed) return false
81+
if (freeFlowSpeed != other.freeFlowSpeed) return false
82+
if (constrainedFlowSpeed != other.constrainedFlowSpeed) return false
7783
if (ramp != other.ramp) return false
7884
if (motorway != other.motorway) return false
7985
if (bridge != other.bridge) return false
@@ -103,6 +109,8 @@ class EHorizonEdgeMetadata internal constructor(
103109
result = 31 * result + functionRoadClass.hashCode()
104110
result = 31 * result + speedLimit.hashCode()
105111
result = 31 * result + speed.hashCode()
112+
result = 31 * result + freeFlowSpeed.hashCode()
113+
result = 31 * result + constrainedFlowSpeed.hashCode()
106114
result = 31 * result + ramp.hashCode()
107115
result = 31 * result + motorway.hashCode()
108116
result = 31 * result + bridge.hashCode()
@@ -132,6 +140,8 @@ class EHorizonEdgeMetadata internal constructor(
132140
"functionRoadClass='$functionRoadClass', " +
133141
"speedLimit=$speedLimit, " +
134142
"speed=$speed, " +
143+
"freeFlowSpeed=$freeFlowSpeed, " +
144+
"constrainedFlowSpeed=$constrainedFlowSpeed, " +
135145
"ramp=$ramp, " +
136146
"motorway=$motorway, " +
137147
"bridge=$bridge, " +

base/src/main/java/com/mapbox/navigation/base/trip/model/eh/EHorizonMapper.kt

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -325,27 +325,29 @@ internal fun RoadObjectEdgeLocation.mapToRoadObjectEdgeLocation(): SDKRoadObject
325325
*/
326326
internal fun EdgeMetadata.mapToEHorizonEdgeMetadata(): EHorizonEdgeMetadata {
327327
return EHorizonEdgeMetadata(
328-
heading,
329-
length,
330-
frc.mapToRoadClass(),
331-
speedLimit,
332-
speed,
333-
ramp,
334-
motorway,
335-
bridge,
336-
tunnel,
337-
toll,
338-
mapNames(names),
339-
laneCount,
340-
meanElevation,
341-
curvature,
342-
countryCodeIso3,
343-
countryCodeIso2,
344-
stateCode,
345-
isRightHandTraffic,
346-
isOneway,
347-
surface.mapToRoadSurface(),
348-
isUrban,
328+
heading = heading,
329+
length = length,
330+
functionRoadClass = frc.mapToRoadClass(),
331+
speedLimit = speedLimit,
332+
speed = speed,
333+
freeFlowSpeed = freeFlowSpeed,
334+
constrainedFlowSpeed = constrainedFlowSpeed,
335+
ramp = ramp,
336+
motorway = motorway,
337+
bridge = bridge,
338+
tunnel = tunnel,
339+
toll = toll,
340+
names = mapNames(names),
341+
laneCount = laneCount,
342+
meanElevation = meanElevation,
343+
curvature = curvature,
344+
countryCodeIso3 = countryCodeIso3,
345+
countryCodeIso2 = countryCodeIso2,
346+
stateCode = stateCode,
347+
isRightHandTraffic = isRightHandTraffic,
348+
isOneWay = isOneway,
349+
roadSurface = surface.mapToRoadSurface(),
350+
isUrban = isUrban,
349351
)
350352
}
351353

0 commit comments

Comments
 (0)