Switch to full style
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Forum rules

Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.
Post a reply

Re: [Script] WME Junction Angle Info

Mon Feb 04, 2019 10:49 pm

Interesting example! It seems that JAI is simply evaluating each endpoint's turn angle independently and comparing their difference, presuming a mostly-straight median segment. To truly check for parallelism would require evaluating absolute directions of departure segments instead of relative angles between connected segments.

Re: [Script] WME Junction Angle Info

Mon Feb 04, 2019 10:50 pm

ituajr wrote:It appears that the U-turn avoidance conditions are not being evaluated correctly by JAI. The third condition is described in Preventing median U-turns as "In/out parallelism: The in and out segments (A and C) are within ±5° of parallel to each other."

I believe that JAI is correct, whereas that Wiki page is not. "Parallelism" is not the criterion. The criterion is 2 turn angles that add up to 180° (or very close).

If all the segments are straight, then 2 turns adding up to 180° means that the incoming & outgoing segments will be parallel. But if the middle segment is curved (as shown in your example above), then 2 angles adding up to 180° means the incoming & outgoing segments definitely won't be parallel.

In fact, the easiest way to "break" u-turn prevention (if you want to enable u-turns) is to kink the connecting segment. In & out remain parallel, but the total angle is no longer 180°

Re: [Script] WME Junction Angle Info

Mon Feb 04, 2019 11:24 pm

iainhouse wrote:
ituajr wrote:It appears that the U-turn avoidance conditions are not being evaluated correctly by JAI. The third condition is described in Preventing median U-turns as "In/out parallelism: The in and out segments (A and C) are within ±5° of parallel to each other."

I believe that JAI is correct, whereas that Wiki page is not. "Parallelism" is not the criterion. The criterion is 2 turn angles that add up to 180° (or very close).

If all the segments are straight, then 2 turns adding up to 180° means that the incoming & outgoing segments will be parallel. But if the middle segment is curved (as shown in your example above), then 2 angles adding up to 180° means the incoming & outgoing segments definitely won't be parallel.

In fact, the easiest way to "break" u-turn prevention (if you want to enable u-turns) is to kink the connecting segment. In & out remain parallel, but the total angle is no longer 180°

No the Wiki is correct.
It is wel described in this part.
It is a detection for preventing to make a double-left or double-right turn.
In this case JAI gives a false positive u-turn prevention. The intermediate segment must be a straight segment to determine the correct angles with JAI.

Re: [Script] WME Junction Angle Info

Tue Feb 05, 2019 12:44 am

To check Waze actual routing behaviour I have modified the test case to provide an alternative but much longer route which avoids the (apparent) U-turn. Waiting for a tile update...

Re: [Script] WME Junction Angle Info

Thu Feb 07, 2019 9:37 am

ituajr wrote:It appears that the U-turn avoidance conditions are not being evaluated correctly by JAI. The third condition is described in Preventing median U-turns as "In/out parallelism: The in and out segments (A and C) are within ±5° of parallel to each other."

The following screenshot shows that the yellow U-turn prevention" bubble is shown for in/out segments that are nowhere near parallel.
The attachment JAI U-turn.JPG is no longer available

The intermediate segment is 8 metres long. The test configuration is at Permalink, in South Australia.

JAI is version 2.0.8, running under Tampermonkey in Chrome Version 71.0.3578.98.


Hi!
I think is the first time we see this case...

herrchin wrote:Interesting example! It seems that JAI is simply evaluating each endpoint's turn angle independently and comparing their difference, presuming a mostly-straight median segment. To truly check for parallelism would require evaluating absolute directions of departure segments instead of relative angles between connected segments.


It's exactly that...

JAI calculates the angles formed by the node and the last geometry point of each segment

Here, in particular case, the segment has a length <15m

another example that we will never meet in real...
JAI_exemple.png
exemple
(75 KiB) Downloaded 144 times

Re: [Script] WME Junction Angle Info

Thu Feb 07, 2019 10:21 am

For now, the solution is to move the final geometry points.

Like this:
JAI_Exemple2.png
Exemple2
(84.22 KiB) Downloaded 148 times

Re: [Script] WME Junction Angle Info

Thu Feb 07, 2019 5:30 pm

Hey guys. Been way too long since I did any map editing :( Anyhow, is it too much to ask to create a pull request on Github for fixes/features instead of making yet another copy somewhere else? It's also possible to add eager people as collaborators for easier development..

Anyhow, the whole code could use some love at some point (read: complete rewrite), to make it more readable and efficient :)

Re: [Script] WME Junction Angle Info

Thu Feb 07, 2019 5:46 pm

Hi milkboy,

Nice to read you :).

milkboy wrote:Anyhow, is it too much to ask to create a pull request on Github for fixes/features instead of making yet another copy somewhere else?

I sent you some mp some time ago.

milkboy wrote:It's also possible to add eager people as collaborators for easier development..

Why not... ;)

Re: [Script] WME Junction Angle Info

Sun Feb 10, 2019 4:45 am

seb-d59 wrote:For now, the solution is to move the final geometry points.

For me, the solution is to confirm what Waze routing actually does, and change either the Wiki or JAI to match that behaviour.

Unfortunately, my test configurations were inconclusive.
  • Route Speeds happily routes through this segment, even though JAI says it shouldn't.
  • Route Speeds happily routes through this segment, even though the Wiki says it shouldn't.
  • Route Speeds and the Live Map happily route through this segment from the northwest, even though JAI and the Wiki both say they shouldn't. I even tested this one starting 25 intersections away, and starting over 100 km away, in case the warnings about not preventing U-turns near the start of a route are relevant.
All three of these have an alternative route that could have been chosen if U-turn prevention was working.

I conclude that this isn't an adequate method of testing, and I need to set up test intersections that I can use in the app to confirm the routing behaviour.

Re: [Script] WME Junction Angle Info

Sun Feb 10, 2019 5:19 pm

Yes this is correct.
The wiki description is not complete yet.
An additional condition to prevent the median u-turn is that at least one of the two parallel segments must be of type PS or higher.
Post a reply