[Script] WME Junction Angle Info

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.

Moderators: Unholy, bextein, Glodenox, JustinS83

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.

Re: [Script] WME Junction Angle Info

Postby herrchin » 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.
USA Country Manager / UT and IA SM
[ img ][ img ][ img ][ img ][ img ][ img ]
herrchin
Country Manager
Country Manager
 
Posts: 328
Joined: Mon Jun 22, 2015 6:05 pm
Location: Lincoln, NE, USA
Has thanked: 296 times
Been thanked: 215 times

Re: [Script] WME Junction Angle Info

Postby iainhouse » 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°
[ img ][ img ][ img ]
UK AdminsUK WikiWaze FAQWMEFU Script :ugeek:
I want to go to a commune in Vermont and deal with no unit of time shorter than a season
iainhouse
Country Manager
Country Manager
 
Posts: 9940
Joined: Mon Jul 23, 2012 5:16 pm
Location: on the road from London to insanity, with Waze HQ in the driving seat
Has thanked: 2570 times
Been thanked: 7962 times

Re: [Script] WME Junction Angle Info

Postby Leorenaud » 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.
[ img ][ img ][ img ][ img ][ img ]
Global Champ
Country Manager Benelux
Regio Manager: Gelderland
Benelux wiki - Waze Nederland Slack invite
Leorenaud
Waze Global Champs
Waze Global Champs
 
Posts: 2032
Joined: Sun Nov 04, 2012 3:32 pm
Location: Benelux, The Netherlands, Nijmegen - Wageningen
Has thanked: 182 times
Been thanked: 539 times

Re: [Script] WME Junction Angle Info

Postby ituajr » 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...
[ img ] [ img ] [ img ]
Country Coordinator for Australia.
77777 km driven with Waze, 2034 km paved,
8586 Update Requests resolved, 14100 map problems closed.
ituajr
Waze Global Champs
Waze Global Champs
 
Posts: 3832
Joined: Wed Oct 26, 2011 11:23 pm
Location: South Australia
Has thanked: 398 times
Been thanked: 2067 times

Re: [Script] WME Junction Angle Info

Postby seb-d59 » 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
seb-d59
Waze Local Champs
Waze Local Champs
 
Posts: 1841
Joined: Fri Jan 03, 2014 8:01 am
Location: Croix (59)
Has thanked: 506 times
Been thanked: 603 times

Re: [Script] WME Junction Angle Info

Postby seb-d59 » 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
seb-d59
Waze Local Champs
Waze Local Champs
 
Posts: 1841
Joined: Fri Jan 03, 2014 8:01 am
Location: Croix (59)
Has thanked: 506 times
Been thanked: 603 times

Re: [Script] WME Junction Angle Info

Postby milkboy » 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 :)
Nexus 5 | CM 13 (Android 6.0.1 nightly)
[ img ][ img ][ img ][ img ]
Škoda Octavia III Combi 2.0 TDI RS DSG 2014 [ img ]
milkboy
Map Editor - level 3
Map Editor - level 3
 
Posts: 107
Joined: Thu Jun 09, 2011 6:24 am
Location: Europe/Finland/Helsinki
Has thanked: 11 times
Been thanked: 123 times

Re: [Script] WME Junction Angle Info

Postby seb-d59 » 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... ;)
seb-d59
Waze Local Champs
Waze Local Champs
 
Posts: 1841
Joined: Fri Jan 03, 2014 8:01 am
Location: Croix (59)
Has thanked: 506 times
Been thanked: 603 times

Re: [Script] WME Junction Angle Info

Postby ituajr » 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.
[ img ] [ img ] [ img ]
Country Coordinator for Australia.
77777 km driven with Waze, 2034 km paved,
8586 Update Requests resolved, 14100 map problems closed.
ituajr
Waze Global Champs
Waze Global Champs
 
Posts: 3832
Joined: Wed Oct 26, 2011 11:23 pm
Location: South Australia
Has thanked: 398 times
Been thanked: 2067 times

Re: [Script] WME Junction Angle Info

Postby Leorenaud » 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.
[ img ][ img ][ img ][ img ][ img ]
Global Champ
Country Manager Benelux
Regio Manager: Gelderland
Benelux wiki - Waze Nederland Slack invite
Leorenaud
Waze Global Champs
Waze Global Champs
 
Posts: 2032
Joined: Sun Nov 04, 2012 3:32 pm
Location: Benelux, The Netherlands, Nijmegen - Wageningen
Has thanked: 182 times
Been thanked: 539 times

PreviousNext

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: No registered users