-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mini_roundabout #21007
base: master
Are you sure you want to change the base?
Add mini_roundabout #21007
Conversation
@@ -1456,6 +1447,34 @@ private TurnType processRoundaboutTurn(List<RouteSegmentResult> result, int i, b | |||
} | |||
return t; | |||
} | |||
|
|||
private TurnType processMiniRoundaboutTurn(List<RouteSegmentResult> result, int i, boolean leftSide) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to move new code to separate class > 2000 lines already in this class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create 2 new classes RoadSplitStructure and RoundaboutTurn
@@ -702,6 +701,47 @@ public boolean roundabout() { | |||
return false; | |||
} | |||
|
|||
public boolean miniRoundabout() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need these in generic class if they could be implemented as
public String getFirstPointTypeByTag(String tag)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as redundant
@@ -1280,6 +1268,9 @@ private TurnType getTurnInfo(List<RouteSegmentResult> result, int i, boolean lef | |||
if (rr.getObject().roundabout()) { | |||
return processRoundaboutTurn(result, i, leftSide, prev, rr); | |||
} | |||
if (rr.getObject().miniRoundabout() && prev.getObject().miniRoundabout()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We check full method for roundabout ? Where is iteration point by point to test which point exactly is roundabout. What if there are 2 roundabouts on the way, roundabout in the middle.
Code looks suspiciously wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realised in new class RoundaboutTurn isMiniRoundabout
int[] prevTypes = prev.getObject().getPointTypes(prev.getEndPointIndex());
int[] currentTypes = current.getObject().getPointTypes(current.getStartPointIndex());
int[] prevTypes = prev.getObject().getPointTypes(prev.getEndPointIndex()); | ||
int[] currentTypes = current.getObject().getPointTypes(current.getStartPointIndex()); | ||
if (prevTypes != null && currentTypes != null) { | ||
Integer miniType = prev.getObject().region.decodingRules.get("highway#mini_roundabout"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RouteRegion.searchRouteEncodingRule
|
To issue #20417