Add minor stop 10281

This commit is contained in:
Kseniia 2021-03-02 11:17:30 +02:00
parent 605034783e
commit e15dece046
2 changed files with 5 additions and 47 deletions

View file

@ -112,6 +112,7 @@ 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'

View file

@ -203,60 +203,17 @@ public class RouteResultPreparation {
for (int stop : stops) {
List<RouteSegmentResult> attachedRoutes = seg.getAttachedRoutes(stop);
for (RouteSegmentResult attached : attachedRoutes) {
int attStopPriority = highwayStopPriority(attached.getObject().getHighway());
int segStopPriority = highwayStopPriority(seg.getObject().getHighway());
if (segStopPriority > attStopPriority) {
int attStopPriority = highwaySpeakPriority(attached.getObject().getHighway());
int segStopPriority = highwaySpeakPriority(seg.getObject().getHighway());
if (segStopPriority < attStopPriority) {
seg.getObject().removePointType(stop, seg.getObject().region.stopSign);
break;
}
}
}
return seg;
}
private int highwayStopPriority(String highway) {
if (highway.endsWith("trunk")) {
return 13;
}
if (highway.endsWith("trunk_link")) {
return 12;
}
if (highway.endsWith("primary")) {
return 11;
}
if (highway.endsWith("primary_link")) {
return 10;
}
if (highway.endsWith("secondary")) {
return 9;
}
if (highway.endsWith("secondary_link")) {
return 8;
}
if (highway.endsWith("tertiary")) {
return 7;
}
if (highway.endsWith("tertiary_link")) {
return 6;
}
if (highway.endsWith("residential")) {
return 5;
}
if (highway.endsWith("living_street")) {
return 4;
}
if (highway.endsWith("track")) {
return 3;
}
if (highway.endsWith("footway")) {
return 2;
}
if (highway.endsWith("path")) {
return 1;
}
return 0;
}
public void prepareTurnResults(RoutingContext ctx, List<RouteSegmentResult> result) {
for (int i = 0; i < result.size(); i ++) {
TurnType turnType = getTurnInfo(result, i, ctx.leftSideNavigation);