This commit is contained in:
Victor Shcherb 2020-06-11 01:29:59 +02:00
parent 41cc9fcd3f
commit d3ef4fb292
3 changed files with 9 additions and 3 deletions

View file

@ -301,7 +301,8 @@ public class RoutePlannerFrontEnd {
int py = MapUtils.get31TileNumberY(point.getLatitude()); int py = MapUtils.get31TileNumberY(point.getLatitude());
int pind = st ? routeSegmentResult.getStartPointIndex() : routeSegmentResult.getEndPointIndex(); int pind = st ? routeSegmentResult.getStartPointIndex() : routeSegmentResult.getEndPointIndex();
RouteDataObject r = routeSegmentResult.getObject(); RouteDataObject r = new RouteDataObject(routeSegmentResult.getObject());
routeSegmentResult.setObject(r);
QuadPoint before = null; QuadPoint before = null;
QuadPoint after = null; QuadPoint after = null;
if (pind > 0) { if (pind > 0) {

View file

@ -394,7 +394,6 @@ public class RouteResultPreparation {
} }
// reverse it just to attach good direction roads // reverse it just to attach good direction roads
Collections.reverse(result); Collections.reverse(result);
segment = finalSegment.reverseWaySearch ? finalSegment.opposite.getParentRoute() : finalSegment; segment = finalSegment.reverseWaySearch ? finalSegment.opposite.getParentRoute() : finalSegment;
int parentSegmentEnd = finalSegment.reverseWaySearch ? finalSegment.opposite.getParentSegmentEnd() : finalSegment.opposite.getSegmentStart(); int parentSegmentEnd = finalSegment.reverseWaySearch ? finalSegment.opposite.getParentSegmentEnd() : finalSegment.opposite.getSegmentStart();
parentRoutingTime = -1; parentRoutingTime = -1;

View file

@ -23,7 +23,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
public class RouteSegmentResult implements StringExternalizable<RouteDataBundle> { public class RouteSegmentResult implements StringExternalizable<RouteDataBundle> {
// this should be bigger (50-80m) but tests need to be fixed first // this should be bigger (50-80m) but tests need to be fixed first
private static final float DIST_BEARING_DETECT = 5; private static final float DIST_BEARING_DETECT = 5;
private final RouteDataObject object; private RouteDataObject object;
private int startPointIndex; private int startPointIndex;
private int endPointIndex; private int endPointIndex;
private List<RouteSegmentResult>[] attachedRoutes; private List<RouteSegmentResult>[] attachedRoutes;
@ -535,10 +535,16 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public void setObject(RouteDataObject r) {
this.object = r;
}
@Override @Override
public String toString() { public String toString() {
return object.toString() + ": " + startPointIndex + "-" + endPointIndex; return object.toString() + ": " + startPointIndex + "-" + endPointIndex;
} }
} }