-
-
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
Use turn:lanes to display the appropriate symbols for lanes #632
Conversation
|
This is very neat change. I like it. I have only 2 comments will put in place. |
| @@ -543,6 +543,78 @@ private TurnType attachKeepLeftInfoAndLanes(boolean leftSide, RouteSegmentResult | |||
| } | |||
| // } | |||
|
|
|||
| String turnLanes = prevSegm.getObject().getValue("turn:lanes"); | |||
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.
Please move whole code into separate function and call it "getTurnLanesData" or something
|
I think this is very important change, please let me know if you need any help. |
|
I made the changes you mentioned except for having the methods only because there would be 8 methods for this. If you want, I can go ahead and create those methods. Also, I removed some code that wouldn't be necessary. I didn't realize at the time that I could just use the TurnType.value() method to determine what turn was needed. Known BugsSome ways that have a valid In addition, at the next intersection with the right-turn split, the left-most lane would be turning left and is marked as such; however, that lane and the two other lanes going straight would be green since, at that point, all three lanes are allowed. Currently, the TSLL and TSLR icons are used for "slight left" and "slight right". However, the icons are not that distinguishable from the C (straight) icon. The KL and KR icons could be used instead, but aligning the KR icon with the C icon is a little problematic, since part of the icon is cut off from rendering. ScreenshotsNo
|
| public static final int BIT_LANE_USE_SLIGHT_LEFT = 1 << 12; | ||
| public static final int BIT_LANE_USE_RIGHT = 1 << 12 | 1 << 11; | ||
| public static final int BIT_LANE_USE_LEFT = 1 << 13; | ||
| public static final int BIT_LANE_USE_SHARP_RIGHT = 1 << 13 | 1 << 11; |
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.
BIT_LANE_USE_SHARP_RIGHT
BIT_LANE_USE_SHARP_LEFT
BIT_LANE_USE_UTURN
BIT_LANE_USE_RIGHT
but they are are using OR , so BIT_LANE_USE_RIGHT = BIT_LANE_USE_SLIGHT_LEFT | BIT_LANE_USE_SLIGHT_RIGHT. What is the logic about it?
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.
It's like bit fields.
BIT_LANE_USE_STRAIGHT = 000
BIT_LANE_USE_SLIGHT_RIGHT = 001
BIT_LANE_USE_SLIGHT_LEFT = 010
BIT_LANE_USE_RIGHT = 011
BIT_LANE_USE_LEFT = 100
BIT_LANE_USE_SHARP_RIGHT = 101
BIT_LANE_USE_SHARP_LEFT = 110
BIT_LANE_USE_UTURN = 111
That being said, I'm considering removing those fields, since they probably won't be used.
|
We need to show green only direction which is needed. For example if one lane straight/right we need to indicate only "right" but keep straight grey.
My idea is to develop new appendix which could be drawn separately from main turn and will be drawn under main turn, so little overlap is possible . If it is not possible, then I would strongly suggest to not combine turns at all and only show main direction turn. 'turn:lanes tag present, but is not used because of the restriction.' |
|
The screenshot for the text is the one above, so it's the one with just the straight arrows. I'll edit the post to add some spacing. Edit: something in Github's system is preventing me from adding spacing. |
|
If the user is on a freeway and taking an exit, the turn will be considered a keep-right or slightly right turn, and so the coloring should be fine (once I add in the code for selective rendering). However, if the user isn't taking the exit, the turn will be considered as a keep-left, but in actuality, you're just going straight (and is probably going to be marked as such in In the left+U-turn case, couldn't just the left turn arrow be shown, which might imply that U-turns are allowed? |
|
Mostly left-turn implies U-turn, if there is no specific restriction. But many times there is that restriction. So I would say we should have only logic how do we display! That means if we are interested in U-turn we should show u-turn, if not we should show just left turn. I guess you've got about coloring issue, which basically means that only interested directions should be green, even though interested and non-interested direction could share the line. Again if we can't develop additional icons to put under main direction, than it is better to show only 1 direction per line! I'm not sure if I get your logic about attachKeepLeftInfoAndLanes. Also I think you misunderstand my question about BIT_LANE_USE_SHARP_RIGHT, this constant is never used what is it about? |
|
On the freeway, (assuming there's an exit coming up on the right) if the user isn't taking the exit, then that method calculates the turn to be a keep left, but it's not announced. However, The constant was for determining what turn we're making (primarily in the case of lanes that have multiple allowed turns). However, I later realized I could just use TurnInfo's value to get the value. I've taken it out of the code locally. |
|
Yes, I understand about keep left. Basically we need to have "keep left" as visible indicator on the right, lanes should represent turn:lanes. Basically this is a different question, once there is a deviation we assume 2 (1 + 1) lanes straight. In reality it could be 3 + 3 lanes straight.
|
|
|
I think I get what you're saying, but what is the [0, 1, 2, 1]? Is this the number of lanes in the target/outgoing roads? |
|
[0, 1, 2, 1] - is number of lanes from target roads. |
|
Well you might think that I'm trying to over complicate situation, but I do know people who would be more confused with your current implementation, rather with default now, because of highlighting 2 directions for the same lane. Also we need to have combined approach taking into account tag lanes and tag turn:lanes. |
|
I understand. I'll see what I can do. |
|
I've made progress on this and completed most of the points you mentioned. I'm still testing this. Known bugs (to be fixed):
|
|
Cool looking forward. |
|
Could you please check if the code will work right in the situation I describe at |
|
Yes and no. Yes, the turn indicators will appear for the turn at the right-turn islands (just before the intersection) (assuming I can get the bugs in this case worked out). No, at the moment, the turn indicators will not appear at the main intersection; I'm planning to have this in a later pull request. No, turn indicators will not appear if The |
|
Update: because of how turns are considered and calculated, the highlighting of lanes won't be too accurate at signals where there is a right-turn island (like the case in @aceman444's link). In these cases, all of the lanes that can be taken to go onto the correct road will be highlighted. This may mean that all lanes are highlighted. |
|
I was more interested if you highlight only the left most lane to be in when wanting to turn left after first crossing the intersecting oneway road to right. If there is the right turn island then yes, the number of lanes may (sometimes does not) change after the right lane branching off. If the number or direction of lanes changes in the last 10 meters before intersection, there is not much you can do. I'm OK with not supporting the turnlanes relations. Not even JOSM supports them (only with plugin) and I think they are not approved yet. May I also point you to a bug where OsmAnd displays wrong number of lanes on a road? Would that be something you could look into? |
|
It's slowly getting there. I'm working on "merging" the lane indicators if there are two turns that are within 60 meters of each other. This will make it possible to highlight the left-most lane in the case of a left turn, and possibly highlight only the straight lanes in the case of going straight. Sure. I already did a bit of an overhaul of the lane parsing/rendering methods, so I could fix that bug as well. |
|
@vshcherb, commits up to and including saiarcot895/Osmand@4da28ad should be beta-ish, and could go in for testing the basic |
|
saiarcot895, the bug I talk about in my previous comment is at https://groups.google.com/d/msg/osmand/WPOK6_vK9RY/4akWHyGru6cJ . You can open a new issue for it as you wish. Thanks. |
|
I've added support for showing the turn lanes in the case of left turns and right turns (assuming the segment connected to the turning point is tagged). There's just one small bug: in the case of left turns on a divided road, any right turn lanes won't be displayed. |
…ight, OR the allowed lanes with 1 to make them active
|
Who can look at this and merge it before it bitrots again? |
|
Anybody there? If there is some other part of |
|
"Anybody there? If there is some other part of turn:lanes that needs to be implemented first before merging, please do note that here." I edit OSM in JOSM, I use lanes:forward, lanes:backward, turn:lanes:forward, turn:lanes:backward tag keys with different values (slight_right|through;right...) I think displaying turn lanes indicators should be based on logical analysis of turn:lanes tags. "Lane and road atrributes" view in JOSM shows correctly the structure of lanes. I think lane symbols could be optionally showed not only at routing helper points but where such information is available (just like as speed limit, other comment: using maxspeed:forward, maxspeed:backward tags cause problems showing speed limits where speed limits are different by directions. The maxspeed:lane tag key is also a valid option.) |
|
In my opinion, it can get a little complicated if displaying Regarding My goal is to try to support the |
|
Ok, maybe realtime displaying of lane symbols at no turning point is not so important during routing (optional). One thing what I forgot to mention before: destination:lanes (also destination:lanes:forward, destination:lanes:backward). |
|
Yes, please. turn:lanes:forward and turn:lanes:backward are very important to support. |
|
@aceman444 @demeterm Do you know of any |
|
I do not know OsmAnd source code well, but what I have found are related routing (road direction in BinaryRoutePlanner) transport (ForwardStops in TransportReader...?). I know from my routing experiences where maxspeed:forward, maxspeed:backward are set there is no displayed maxspeed information. I think direction related tags are nor supported yet. |
|
My first guess was that I would have to use the points in Now I need to test this to see if the |
…ction of the way.
165c74d
to
139e997
Compare
|
Well, that was easy. Support has been added for |
There probably is not support for directional tags in OsmAnd and that it quite bad. That is why I wish there would be some as in my country most roads are mapped as single way for both directions and that is where turns:lanes: and lanes: are used. Only some very big intersections (and motorways) have separate way for each direction. So thanks for looking into it. I hope somebody reviews the patches soon. |
|
I use your branch (compiled, other comment: your branch is 1185 commits behind osmandapp:master) but there must be a bug. The app shows lanes where lanes & turn:lanes tags are set, but does not show any lanes where lanes:forward & turn:lanes:forward tags are used (no lanes tags are set because number of lanes should be the number of lanes:forward + the number of lanes:backward). |
|
@demeterm, do you mean that the lanes aren't showing up where As for the branch, it was initially forked early May, but then after merge conflicts came up late July/early August, I rebased my branch so that my commits were on top of the commits in |
|
Also, make sure you're on the |
|
Do you plan to get this into 1.9? |
|
That depends mostly on @vshcherb, whose last comment on this PR was on July 6. I will continue to have my own branch be close to master until this is merged, so that the latest features are also in my version. That being said, it looks like there are some new merge conflicts. Time to rebase this. |
|
Correction: at least some of the code in this PR (including support for getting the direction of the way) has been added into the master branch (in particular, commits 2c6b19b, e27a425, and 19ef80c). Because of this, I might hold off on the rebase for a couple of days until @vshcherb can add in the code here (in a more maintainable way) to the master branch. |
|
@saiarcot895 I have compiled turn-lanes branch version, it works fine so far. I will test it more deeply. What is your opinion about supporting destination:lanes tag? |
|
I'll see what's going on with that way. For Regarding the tagging, this page seems to imply the best practice is to have the |
|
The compiled turn:lanes version works fine, your master branch was problematic. |
|
This pull request can't be merged automatically and even manually it is a difficult process. Please continue to work, but keep in mind that complex should be merged step by step which easy to review. |
|
Will do. To others, note that the |







If available and valid, the
turn:lanestag will be used to determine the symbols to show for each lane. Support for all values except U-turn and lane merges have been added; however, the symbols are not aligned yet and may look bad.Unfortunately, there isn't enough usage of this to get a good testing ground, but this way looks good.