Add minor stop 10281
This commit is contained in:
parent
e15dece046
commit
368b2ff8f9
3 changed files with 26 additions and 10 deletions
|
@ -112,7 +112,6 @@ dependencies {
|
|||
implementation group: 'org.json', name: 'json', version: '20171018'
|
||||
implementation 'it.unibo.alice.tuprolog:tuprolog:3.2.1'
|
||||
implementation 'org.apache.commons:commons-compress:1.17'
|
||||
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'
|
||||
implementation 'com.moparisthebest:junidecode:0.1.1'
|
||||
implementation 'com.vividsolutions:jts-core:1.14.0'
|
||||
implementation 'com.google.openlocationcode:openlocationcode:1.0.4'
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.osmand.util.Algorithms;
|
|||
import net.osmand.util.MapUtils;
|
||||
import net.osmand.util.TransliterationHelper;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
@ -504,9 +503,16 @@ public class RouteDataObject {
|
|||
public void removePointType(int ind, int type) {
|
||||
if (pointTypes != null || ind < pointTypes.length) {
|
||||
int[] typesArr = pointTypes[ind];
|
||||
for (int t : typesArr) {
|
||||
if (t == type) {
|
||||
pointTypes[ind] = ArrayUtils.removeElement(typesArr, t);
|
||||
|
||||
for (int i = 0; i < typesArr.length; i++) {
|
||||
if (typesArr[i] == type) {
|
||||
int[] result = new int[typesArr.length - 1];
|
||||
System.arraycopy(typesArr, 0, result, 0, i);
|
||||
if (typesArr.length != i) {
|
||||
System.arraycopy(typesArr, i + 1, result, i, typesArr.length - 1 - i);
|
||||
pointTypes[ind] = result;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,19 +177,30 @@ public class RouteResultPreparation {
|
|||
validateAllPointsConnected(result);
|
||||
splitRoadsAndAttachRoadSegments(ctx, result, recalculation);
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
prepareStopSign(result.get(i));
|
||||
filterMinorStops(result.get(i));
|
||||
}
|
||||
calculateTimeSpeed(ctx, result);
|
||||
prepareTurnResults(ctx, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public RouteSegmentResult prepareStopSign(RouteSegmentResult seg) {
|
||||
int start = seg.getStartPointIndex();
|
||||
int end = seg.getEndPointIndex();
|
||||
public RouteSegmentResult filterMinorStops(RouteSegmentResult seg) {
|
||||
int startPoint = seg.getStartPointIndex();
|
||||
int endPoint = seg.getEndPointIndex();
|
||||
int start;
|
||||
int end;
|
||||
|
||||
if (startPoint < endPoint) {
|
||||
start = startPoint;
|
||||
end = endPoint;
|
||||
} else {
|
||||
start = endPoint;
|
||||
end = startPoint;
|
||||
}
|
||||
|
||||
List<Integer> stops = new ArrayList<>();
|
||||
|
||||
for (int i = start; i > end; i--) {
|
||||
for (int i = start; i < end; i++) {
|
||||
int[] pointTypes = seg.getObject().getPointTypes(i);
|
||||
if (pointTypes != null) {
|
||||
for (int j = 0; j < pointTypes.length; j++) {
|
||||
|
|
Loading…
Reference in a new issue