# User:Sketch/Junction Style Guide

The following article contains key information on properly creating junctions and the roadways between them. Be sure to review it in its entirety before editing the map.

## Simple is better

When representing junctions (a.k.a. intersections, cross roads, corners, etc.) between roads, we sometimes have to blur the lines between the physical and logical worlds. The primary goal should be to represent things as simply as possible and only introduce complexity to deal with an issue.

## The Basics ← START HERE

### What is a Junction?

A junction is made up of three things:

1. Two or more road segments
2. One point where all the segments meet (the junction itself)
3. Turns allowed or restricted when traveling from one segment to another through that junction point

If you do not know how to create and modify roads, junctions, or turns, please read the Map Editing Quick-start Guide. Then review the specific article on moving and removing junctions. Also refer to the glossary under Junction to see images of the different junctions depending on their state or condition.

Let's start with the basic case of a road branching off. The branch road will normally meet the main road at nearly a 90 degree angle. This is the simplest situation to map, as the physical and logical views of the roads match up well.

You will find roads that meet at odd angles as well. Even in urban areas with rigid grids, you will often find a road that existed prior to the establishment of the grid, which cuts through town at strange angles. The initial urge will be to represent the junction as it is in the physical world - two lines running into each other at a sharp angle.

But there are issues with this method. Depending on the angle, the client may give a "Keep Right" instruction to the driver when a "Turn Right" instruction is more appropriate. If Minor Highways or above are involved, you will actually get an "Exit Right" which can be confusing in many situations. In some cases, no instruction will be given at all. In the worst case, the routing server may determine that it isn't possible to make a very sharp turn angle and not suggest the turn at all (in the example image, heading south, then turning left, to head east). Finally, automatic map errors may appear with turns from one direction as the path of the turning traffic is "too far" away from the actual junction (in this example, traveling south, then turning left to head east).

To eliminate ambiguity, we need to map the junction from a logical point of view. Since we want to be given basic "Turn Left" and "Turn Right" instructions, we have to tweak it so it resembles a basic 90 degree intersection. But how do we do that when the roads don't actually diverge at 90 degrees? We add some geometry nodes to make the branch road leave the main road at close to 90 degrees, then we gradually curve the road to match the true departure angle.

Now we have a junction that logically works like a basic 90 degree junction, but it also fits the reality of the physical world. Here is a completed real world example which provides the expected turn instructions and "catches" turns from all directions avoiding automatic "roads are too far apart" problems:

A ramp from a highway is another good example where additional geometry nodes are helpful. Especially since most ramps diverge at a very small angle from the road.

The drawback in this case (which also exists for the side road example above) is it may be hard to see and click on the turn restriction arrows in the editor.

But if we add one more geometry node to make the departure angle at the junction closer to 20 or 30 degrees. See the discussion on Geometry and turn instructions later in the page for details on those angles.

Now the arrows are visible and accessible. Note that you can also press s in the editor to spread or separate the arrows at a junction, if you still have difficulty clicking on an arrow. See the keyboard shortcuts article for more tips.

Now we have made sure this junction behaves as we would expect. Because we have used a specific angle, we can clearly see and access the turn restriction arrows, and we have fidelity with the layout of the road system.

We can apply the above approaches to a four-way junction. Again we can expect to see angles close to 90 degrees.

And if we have that street cutting across town at an odd angle, we want to avoid the odd angle at the junction.

We want to use geometry nodes to bring the actual junction close to 90 degrees. You can zoom in and add a single geometry node on each side. This will give the proper angle but make it virtually invisible to users so it looks just like the physical world.

The above image is what you would see zoomed in as close as possible. Zoomed back out, it looks just like the image showing the junction without any geometry nodes.

And here is a real world example at a zoom level where you can still see the geometry adjustment we added:

With that adjustment in place, the junction will produce predictable turn left/right navigation instructions while the roads still appear to meet at the real-world angle.

## Controlling Turn Instructions

Before going further, make sure you understand the mechanics of turn restrictions in the Map Editor. If turns are not properly enabled and restricted, you will never get the proper navigation instructions.

In the Basics section above, we touched on how to ensure a "Turn left/right" instruction would be given over a "Keep left/right" instruction. Details of the mechanics behind this can be found on the How Waze determines turn / keep / exit maneuvers page, but a summary is provided in the sections below.

### Geometry

If all junctions you edit follow a few basic forms, it will be much easier to predict the navigation behavior of an individual junction without getting into the details of the back-end algorithms.

• Approximately 90 degree departure angle = Turn instruction
• Between 20 and 30 degree departure angle:
• when only Primary Street and below are involved = Keep Right / Keep Left instruction
• when Ramps and/or Minor Highway and above are involved = Exit Right / Keep Left instruction for right-hand drive countries, Keep Right / Exit Left instruction for left-hand drive countries
• Approximately 0 degree departure angle = no navigation instruction

NOTE: There are exceptions to these rules since geometry is not the only factor which determines instructions. See later sections for how Segment Naming and Type can impact instructions.

These angles allow us to clearly depict the desired result (turn vs. keep) while staying away from the angles that cause uncertain decisions from the routing algorithms. For example, since 45 degrees is a tipping point for the algorithms, a 44.5 degree angle will behave very differently than a 45.5 degree angle, although they will look identical to the eye.

Similarly, if we have a road split at a Y and we want to be clear about which is "straight" and which bears off to the side, having one branch at zero degrees and the other branch at 5 degrees isn't clear and obvious; but "straight" would be much more apparent if the angles were zero degrees vs. 20 degrees. Since most of us will not have a protractor handy when we are editing, it is best to simply avoid situations where exactness matters.

This knowledge allows us to control how a junction behaves by modifying a single geometry node in most cases. This is often useful for at-grade connectors where sometimes we prefer a "Keep right/left" and other times a "Turn right/left" would be more appropriate.

If we keep the departure angle in the 20 to 30 degree range, we would get a "Keep Right" to follow the curved one-way connector:

But if we move one geometry node to create a 90 degree angle, we would receive a "Turn Right" instruction.

Similar rules apply for the end of that segment as well. If we have a 20 to 30 degree angle as pictured above, there will be no turn instruction, as traffic just smoothly slides into the cross street. But if we make the end of the segment close to a 90 degree angle, then there would be a turn right instruction for the driver.

Furthermore, if the North-South road in that last example were a Minor Highway or a Major Highway, the 20 to 30 degree angle at the start of the connector would produce an "Exit" instruction which may be more confusing than a "Keep" instruction would have been. So unless this connector is signed with an actual exit sign, a 90 degree start to the connector to produce a "Turn" instruction is most likely preferred.

### Segment Naming and Type

The names and road types of the attached segments affect the routing algorithms, in addition to the geometry of the road segments,

A rule of thumb is if you want a turn to be announced, having a name difference between segments will improve the chances (but not guarantee) that it will happen. In the case of the at-grade connector example above, the connector should either have a different name than the road it is leaving, or no name at all. (See At-grade connectors#Road name.)

Road type is a factor in determining navigation instructions as well, but names and angles are much more important. If you have multiple roads meeting at a junction and two of those road segments line up at close to zero degrees and they have the same name, that will be considered straight no matter what road types are used. An example demonstrating this is shown in the discussion on Y-intersections in a later section.

Road type will be the determining factor when all names are different. For example imagine you have a Ramp segment leading to a Freeway segment and another Ramp segment. The Ramp segment will be considered the "straight" continuation and there will be no announcement while a navigation instruction will be given to proceed to the Freeway segment. This is true even if the initial Ramp and the Freeway align at close to 0 degrees and the second Ramp departs at a 20 to 30 degree angle.

## Surface Streets

### Y Intersections

When surface streets meet in a Y formation and we must carefully consider how they are mapped to provide useful navigation instructions. As the How Waze Determines turn/keep/exit maneuvers page explains, segment names and geometry are very important in determining what navigation instructions are given.

In the example below, the multi-lane surface street is known as Main Street to the west and Atlantic Ave to the east. The name change occurs when Main St branches off as a regular surface street.

The description above is how a human would probably describe the situation, but as you can see in the image above, a more technical description would be that Main St travels in a perfectly straight line and Atlantic Ave branches off of it. But if we map it that way in the editor, we create a major problem.

Since the multi-lane segment of Main St and the regular street segment of Main St have the same name, the routing engine automatically considers that to be "straight". If the two sections line up in a straight line the way they appear from the sky, then we are reinforcing the idea that "straight" is Main St. to Main St.

But as a typical driver would want, "straight" should be the path that remains on the multi-lane roadway, regardless of what the name is. To make sure the routing engine understands the proper treatment of the junction, we have to be deliberate with the segment geometry of all three involved segments. We end up with something like this:

Now the geometric definition of straight is the multi-lane portion of Main St. onto Atlantic Ave., since we have made that transition as close to zero degrees as possible. The regular street portion of Main St. now branches off at an angle close to 90 degrees. The routing engine should recognize that a turn is required. So the result is that Main St. to Atlantic Ave. has no announced turn, and multi-lane Main St. to surface road Main St. has a turn announced. Exactly what most drivers would expect in the real world.

Roads which only have one way in and one way out can present challenges to the routing server, although they seem simple to our minds.

Dead Ends (a.k.a. No Exit, Closed, No Through Road, No Outlet) are road segments that simply end, with no continuation or connections at one end. In some areas, a Dead End may be synonymous with a Cul-de-sac. In the US, a "No Outlet" sign may be used to indicate a road which itself is not a dead end, but it only connects to other dead end roads. It can also be used as a "friendlier" alternative to the typical Dead End sign.

Within the Map Editor it is possible to represent a dead end road with multiple segments if there are private driveways or parking lot roads mapped and connected. In that case, only the very last segment is considered the dead end segment.

Make sure that there is a junction indicator (the small blue dot, not just a geometry node) at the very end of the segment. While this one segment does not actually constitute a junction, the small blue dot is a visual indicator to the editor that the end of this segment is properly set up. This is necessary to ensure proper routing out of the segment. See the Cul-de-sac section below on when and how to fix this.

This final junction indicator must be located near the end of the road, but it should be located where there is still pavement as not to negatively impact client routes. Waze only considers the road fully traversed if both ends of the segment are fully crossed. If the junction indicator at the end of the segment happens to be at the edge of the pavement (or off of the road surface if aerials are not exactly aligned), it will be very difficult for a driver to cross that junction. A good rule of thumb is to have the end of the segment the same distance from the end of the pavement as it is from each side of the road.

With such a placement, the driver is given a chance to cross that junction indicator for that segment.

#### Cul-de-sacs

A Cul-de-sac (a.k.a. Court in the US) is a common treatment of a dead end street in a residential neighborhood.

In almost every situation, a cul-de-sac should be treated exactly as a dead end street, with the final junction indicator in the center of the bulb of the cul-de-sac. Be sure the free end of the final road segment has small blue dot displayed at the tip (when not editing or selecting the segment). If there is no blue dot, please correct it by following the steps for fixing dead ends.

The junction indicator should be located close to the middle of the bulb and NOT near the outer edges. If the end of the segment is positioned along the perimeter of the bulb, there may be difficulty in processing client routes. Waze only considers the road fully traversed if both ends of a segment are crossed. If the end of the segment happens to be on the curb (or off of the road surface if aerials are not exactly aligned), it will be very difficult for a driver to cross end end of the road segment. With the junction in the middle of the visual road, we give a driver a good chance to cross the end of the segment no matter where they drive within the bulb. The exception to this guidance is given in the next example.

The cul-de-sac below, with a small island, should be treated as a basic dead end with no loop. The island can be ignored, as there is no significant routing question for the driver once they get to the cul-de-sac.

As for placement of the final junction indicator, here we may get better results by moving the junction out from the true center and over to the outer perimeter of the central island. The shift ensures that the driver has a good opportunity to cross the end of the segment.

However, if the cul-de-sac has a very large bulb with a large island in the middle, it may better be treated as a Loop. A good rule of thumb is if you were standing at the end of the cul-de-sac, can you tell that it is just a cul-de-sac? Or does it look like two different roads? If you see an island, but are not sure if it is significant, leave the Loop out. If "Missing Road" errors occur on the road, then add a Loop.

#### Loops

Loops are roads that you can enter, and without reversing course, end up at the same place you started.

An important Map Editor rule is: a road segment must not start and end on the same junction node.

If this rule is not followed, the routing server will have difficulty in providing routes into and out of the loop. Any loop broken into two segments by a junction will not have this problem.

Hopefully there will be another roadway along the loop road which you can map, which will break the loop into two pieces. If there are no interruptions to the loop and the entire loop is represented by one road segment that connects with itself, we must insert a superfluous junction node along the loop segment. The specific location does not matter, but most people put it near the half-way point of the segment.

NOTE: It is very easy for an editor to find the extra junction node, assume it is truly superfluous, and delete it! This problem is magnified if the loop road is large or shaped so it is not obvious that it is a loop. One solution is to identify a path or driveway branching from the loop road and add it to the map, forcing a 3-way junction that would be less likely to be deleted.

NOTE: The Map Editor may be resistant in editing a loop that does not already follow the rule that it must be broken in two. If you run into saving errors, try one of the following approaches:

If the loop and the road leading to it have the same name:

• Select the loop and the road
• click the bridge icon that appears (one end of the loop will disconnect from the other)
• split the loop
• reconnect the disconnected end of the loop
• confirm turns

If the loop and the road leading to it have different names:

• draw a new road segment that connect to the loop/road junction
• give that new road the same exact name as the loop
• select the loop and the new road segment
• click the bridge icon that appears (one end of the loop will disconnect from the other)
• split the loop
• reconnect the disconnected end of the loop
• confirm turns

Please see the Roundabout page for a full discussion of this special type of junction.

With exceptions, don't set these segments as ramps! Watch out for all of the turns you need to restrict. For a full discussion, see at-grade connectors.

### Bow tie intersections

The "bow tie" form of an intersection both simplifies and provides enhanced control when a dual carriageway road and a single carriageway road intersect.

By reducing the intersection to a single point, we gain control over U-turns and avoid short segments which may introduce complexity and routing issues.

The first instinct may be to map the intersection as the road is physically constructed -- using an "H" (a sideways H in this case) where each one-way roadway intersects the cross street. But if that method is used, there is no way to restrict the U-Turn movement from one one-way direction to the other since the center of the "H" carries both U-Turn traffic and traffic turning from the cross street. But mapped as a bow tie, there is a specific turn arrow that can allow or disallow the U-turn as needed.

Additionally, the center segment of the H may introduce complexity to the map. If the cross street changes names at the junction, care must be taken to make the center segment have no name assigned. This will cause the segment to inherit the appropriate name depending on the direction of travel. This center segment is then different from either side so future "select all segments" operations in the editor will not capture this segment which may complicate editing.

Finally, the Waze systems also have difficulty in capturing average speeds for short segments, especially when traffic does not travel across a majority of the segment which may happen in a wide intersection. The center of the H would be totally vertical in the example above, but turning traffic would be traveling in more of a 45 degree angle. Add in the inaccuracy of many consumer GPS chips and wide intersections and you may have traffic never actually driving over the segment for certain movements.

NOTE: Be aware of the geometry used in the bow tie. If the angles are too steep (45 degrees or greater) a driver traveling along one of the one-way segments may be told to "turn" or "stay" at the intersection instead of receiving no instruction.

NOTE: If the center of the physical "H" is long and/or allows traffic to stop and queue within the median of the divided roadway, a bow tie may not be appropriate. In these cases the segment may be long enough to justify being mapped especially if the one-way roads would have to deviate greatly from their physical location to meet in a single point.

## Interchanges and ramps

An interchange is a road junction where two roads are connected by dedicated roadways, called ramps. The roads connected by an interchange do not intersect one another directly, and if they cross, the crossing is grade-separated.

### When to use ramps

Use of the  Ramp  type is governed by the following rules:

### Ramp and interchange style

For guidance on the proper configuration of ramps and interchanges, see Interchange.

## Special Cases

### Transitions

A transition is a non-junction depicted using a junction node.

Valid examples of where to use a Transition node include:

2. City Limits
4. Part of a Loop Road

An old reason to use a transition node was to indicate segments of the road with different house numbering. With the new point numbering scheme being adopted by Waze, this is no longer a reason to use transition nodes.

There may be existing Transition nodes on the map for other reasons (left after a connecting road was deleted, inherited from to the original base map import when things such as rivers and streams created junctions, etc.).

As long as we are certain it is not a valid Transition node, a superfluous junction node may be deleted. Doing so will simplify the map, eliminate turn restrictions to maintain, and reduce computing resource needs. Also consider removing the geometry node which will replace the junction node you delete, if that geometry node is not needed.

In certain situations it may be necessary to add road segments that are un-drivable in order to provide accurate navigation instructions.

#### Actual

A valid use of this technique is at the temporary end of a freeway. As a freeway is built, it is often opened in sections, up to a certain exit. If we map this as a regular freeway segment leading to a ramp segment, no announcement will be made for that final exit, no matter what we name the exit ramp.

This can be confusing if the ramp is set up as a properly signed and numbered exit, especially if a driver is traveling a long distance on this freeway. Imagine traveling down a freeway and seeing your next instruction is "turn left at Main St." You would probably wonder if there was a map error since you shouldn't be making left turns off of a freeways.

If we map even just a little of the future path of the freeway, this gives the routing engine a junction which will generate an "exit" instruction at the end of the freeway, thus eliminating any confusion.

Conversely, if we do NOT want an exit instruction at the end of a freeway, ensure there are no road segments extending past the final exit, to ensure the final exit is the only path out of the final freeway segment.

(coming soon)