Skip to content

Commit c19fa14

Browse files
DzmitryFomchyngithub-actions[bot]
authored andcommitted
Freeflow attribute (#11309)
* Add new edge metadata properties * Changelog * Update changelog * Bump UXF dependencies GitOrigin-RevId: f37fdf73e834886d9d0b12c4134a195c0a3634f6
1 parent 79617fe commit c19fa14

File tree

5 files changed

+39
-22
lines changed

5 files changed

+39
-22
lines changed

base/api/current.txt

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

15791579
public final class EHorizonEdgeMetadata {
15801580
method public boolean getBridge();
1581+
method public Double? getConstrainedFlowSpeed();
15811582
method public String? getCountryCodeIso2();
15821583
method public String? getCountryCodeIso3();
15831584
method public byte getCurvature();
1585+
method public Double? getFreeFlowSpeed();
15841586
method public String getFunctionRoadClass();
15851587
method public double getHeading();
15861588
method public Byte? getLaneCount();
@@ -1599,9 +1601,11 @@ package com.mapbox.navigation.base.trip.model.eh {
15991601
method public boolean isRightHandTraffic();
16001602
method public boolean isUrban();
16011603
property public final boolean bridge;
1604+
property public final Double? constrainedFlowSpeed;
16021605
property public final String? countryCodeIso2;
16031606
property public final String? countryCodeIso3;
16041607
property public final byte curvature;
1608+
property public final Double? freeFlowSpeed;
16051609
property public final String functionRoadClass;
16061610
property public final double heading;
16071611
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Added `freeFlowSpeed` and `constrainedFlowSpeed` properties to `EHorizonEdgeMetadata` to provide free flow and constrained flow speed information for edges

gradle/dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ext {
1111
// mapboxSdkHdFullSparseCheckout in generate_api_docs_android.sh depends on mapboxSdkVersionSuffix
1212
// Release Train depends on these two lines below
1313
// https://github.com/mapbox/release-train/blob/bd530da200d62fb45166ef91d7d892d90a453fa6/backend/model/step/navcoreandroid/PrepareChangelogNavCore.py#L122-L124
14-
def mapboxSdkVersionSuffix = '17.0-beta.1-SNAPSHOT-11-10--11-43.git-9f387dc'
14+
def mapboxSdkVersionSuffix = '17.0-beta.2'
1515
def mapboxNavigatorVersion = "324.${mapboxSdkVersionSuffix}"
1616

1717
def ndkVersionSuffix = ""

0 commit comments

Comments
 (0)