Add minor stop 10281

This commit is contained in:
Kseniia 2021-03-04 14:15:33 +02:00
parent 368b2ff8f9
commit 9a44cd70e6

View file

@ -185,6 +185,7 @@ public class RouteResultPreparation {
}
public RouteSegmentResult filterMinorStops(RouteSegmentResult seg) {
List<Integer> stops = null;
int startPoint = seg.getStartPointIndex();
int endPoint = seg.getEndPointIndex();
int start;
@ -198,19 +199,22 @@ public class RouteResultPreparation {
end = startPoint;
}
List<Integer> stops = new ArrayList<>();
for (int i = start; i < end; i++) {
int[] pointTypes = seg.getObject().getPointTypes(i);
while (start <= end) {
int[] pointTypes = seg.getObject().getPointTypes(start);
if (pointTypes != null) {
for (int j = 0; j < pointTypes.length; j++) {
if (pointTypes[j] == seg.getObject().region.stopMinor) {
stops.add(i);
if (stops == null) {
stops = new ArrayList<>();
}
stops.add(start);
}
}
}
start++;
}
if (stops != null) {
for (int stop : stops) {
List<RouteSegmentResult> attachedRoutes = seg.getAttachedRoutes(stop);
for (RouteSegmentResult attached : attachedRoutes) {
@ -222,6 +226,7 @@ public class RouteResultPreparation {
}
}
}
}
return seg;
}