# U-Turns are not mentioned on the instructions steps

**URL:** https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851
**Category:** openrouteservice
**Created:** [March 2, 2024, 1:09am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851 "2024-03-02T01:09:37Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![sergiomng](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sergiomng/32/2877_2.png) [@sergiomng](https://ask.openrouteservice.org/u/sergiomng)
#### Post date: [March 2, 2024, 1:09am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/1 "2024-03-02T01:09:38Z")

</div>

I’m using this service to provide directions. Many times, a u-turn is necessary in order to get where you’re going.

I can successfully get the route and the step-instructions, but for some reason, whenever there’s a u-turn, it’s not mentioned on the steps/instructions, even if the u-turn is properly drawn on the route:

These are the parameters I’m sending:  
{“coordinates”:[[’ + start + ‘],[’ + end + ']],“roundabout\_exits”:“true”}

and this is the URL:  
[https://api.openrouteservice.org/v2/directions/driving-car](https://api.openrouteservice.org/v2/directions/driving-car)

![uturn](https://ask.openrouteservice.org/uploads/default/original/2X/3/35082fa3c96fa844f1721f6840d7dba2803cb837.png)

For the image I’m attaching, these are the steps I’m getting:

-Head south on Avenida Líbano  
-Continue straight onto Avenida Líbano  
-Turn right onto Calle 1-H  
-Enter the roundabout and take the 3rd exit onto Calle 19  
-etc…

If someone would read those instructions, would get lost. There should be a **make a u-turn** instruction after the 1st item. I’ve tried to get it on different locations with the same result. This is a simple two way street where you need to make a u-turn to get where the destination is.

Is there something wrong with my request parameters? or do I need to specify somehow that u-turns must be mentioned?

Any help will be really appreciated.  
Best regards!

---

<div class="post-metadata">

### Author: ![jschnell](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/jschnell/32/971_2.png) [@jschnell](https://ask.openrouteservice.org/u/jschnell)
#### Post date: [March 4, 2024, 9:14am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/2 "2024-03-04T09:14:19Z")

</div>

Hey,

it’s hard to see what’s happening in these cases without the request details.  
Could you share your start- and end point?

Best regards

---

<div class="post-metadata">

### Author: ![sergiomng](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sergiomng/32/2877_2.png) [@sergiomng](https://ask.openrouteservice.org/u/sergiomng)
#### Post date: [March 5, 2024, 2:11am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/3 "2024-03-05T02:11:56Z")

</div>

It happens anywhere where a U-Turn is involved. Here are the coordinates for start and end points:

Start: -89.60929870605467,21.00990529379409  
End: -89.59750645974535,21.019615780254412

And the first 2 steps I get are:

(Type: 11) Head south on Avenida Líbano  
(Type: 6) Continue straight onto Avenida Líbano

I’ve read somewhere here, that the Type: 9 indicates a u-turn, and that’s the missing step that should be between the 1st and the 2nd step (the one I pointed with a red arrow on the attached image)

Any help will be really appreciated

---

<div class="post-metadata">

### Author: ![sergiomng](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sergiomng/32/2877_2.png) [@sergiomng](https://ask.openrouteservice.org/u/sergiomng)
#### Post date: [March 7, 2024, 8:07am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/4 "2024-03-07T08:07:24Z")

</div>

Hi, just in case you didn’t get my previous answer (I don’t remember if I tagged you)

here are some other coordinates that you can use to test what I’m saying.

[[-75.30765367967103,39.984496906875016],[-75.30538989528604,39.98212110323286]]

You can paste them on the API Playground ([Dashboard | ORS](https://openrouteservice.org/dev/#/api-docs/v2/directions/))

You’ll se that the route is drawn correctly, but the U-Turn won’t be mentioned on the instructions steps:

“type”:11,“instruction”:“Head southeast on Darby Road”  
“type”:6,“instruction”:“Continue straight onto Darby Road”  
“type”:10,“instruction”:“Arrive at Darby Road, on the right”

As you can see on this image, a U-Turn should be mentioned after the 1st instruction, otherwise, you’d get lost if you just follow these instructions.

![uturn2](https://ask.openrouteservice.org/uploads/default/original/2X/8/8b6b81ab1d6ee9a190584ad9068d2ef938c88569.png)

Is there any workaround for this?

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [March 22, 2024, 1:49pm UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/5 "2024-03-22T13:49:58Z")

</div>

Hi @sergiomng,

there is currently no workaround as it’s a bug that needs fixing.  
It should return type 9 with something like “Make U-Turn onto Darby Road”.  
Would you mind opening an issue in our repo for this with description?

> **[Build software better, together](https://github.com/GIScience/openrouteservice/issues/new/choose)**
>
> GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.

Best regards

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [March 22, 2024, 10:12pm UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/6 "2024-03-22T22:12:14Z")

</div>

Ah, don’t bother. There’s already an existing one:

> <https://github.com/GIScience/openrouteservice/issues/728>
>
> It seems that there is no support in openrouteservice for providing instructions… for u-turns (see InstructionTranslator and InstructionType classes). 
> 
> In the case of round trip routing (for example), it can be the case that a control point results in the route backtracking on itself:
> 
> !\[image\](https://user-images.githubusercontent.com/7126643/82424861-0cd80400-9a86-11ea-83df-510968ed391a.png)
> 
> In these cases, the instructions simply ignore the u-turn as there is not the ability to include it properly in instructions (inside the RouteResultBuilder class).
> 
> Realistically, the openrouteservice result builder should be enhanced to allow the proper use of a u-turn instruction, and in the case of the round trip it should be able to determine if there is a u-turn present without the explicit type being provided by GH. This is because GH would provide a specific via instruction (not supported by openrouteservice) and not a u-turn instruction.

---

<div class="post-metadata">

### Author: ![sergiomng](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sergiomng/32/2877_2.png) [@sergiomng](https://ask.openrouteservice.org/u/sergiomng)
#### Post date: [March 25, 2024, 7:17pm UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/7 "2024-03-25T19:17:08Z")

</div>

Thanks for your answer. Would it help if I open an issue anyway? The one that you mentioned was posted 4 years ago, so it seems that they might need a little reminder 😉

---

<div class="post-metadata">

### Author: ![andrzej](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/andrzej/32/10_2.png) [@andrzej](https://ask.openrouteservice.org/u/andrzej)
#### Post date: [March 25, 2024, 9:33pm UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/8 "2024-03-25T21:33:37Z")

</div>

Please refrain from opening another issue. Instead, you could consider adding a comment with your example and description to the existing issue. Cheers!

---

<div class="post-metadata">

### Author: ![amandus](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/amandus/32/669_2.png) [@amandus](https://ask.openrouteservice.org/u/amandus)
#### Post date: [March 26, 2024, 9:25am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/9 "2024-03-26T09:25:06Z")

</div>

I’ve already got something working locally, if you want to test it out in a local installation:  
in RouteResultBuilder.java:  
add in getInstructionType

```java
            case Instruction.U_TURN_LEFT, Instruction.U_TURN_RIGHT: 
                return InstructionType.UTURN;

```

& add `|| instrType == InstructionType.UTURN` to `isTurnInstruction`

and in InstructionTranslator.java add in getTurnManeuver:

```java
            case UTURN:
                return: 7;

```

Then you will still end up with something like:  
“Turn U-Turn on road-name”

So it needs some extra handling translations for u-turns still to get something like  
“Make U-Turn on road-name”  
But i’m currently stuck on other tasks

Best regards

---

<div class="post-metadata">

### Author: ![sergiomng](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sergiomng/32/2877_2.png) [@sergiomng](https://ask.openrouteservice.org/u/sergiomng)
#### Post date: [April 8, 2024, 5:16am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/10 "2024-04-08T05:16:21Z")

</div>

Thanks for your answer. I didn’t had it running locally, and it took me some time to be able to make it work.

I don’t know if I’m using the same version of ORS than you (v8.0.0), but I just wanted to be sure that this value is correct:

```auto
            case UTURN:
                return: 7;

```

The reason I’m asking is because on InstructionType.java, UTURN has a comment indicating that it’s value should be 9:

> public enum InstructionType {  
> //Keep in sync with documentation: instruction-types.md  
> TURN\_LEFT, /_0_/  
> TURN\_RIGHT, /_1_/  
> TURN\_SHARP\_LEFT, /_2_/  
> TURN\_SHARP\_RIGHT, /_3_/  
> TURN\_SLIGHT\_LEFT, /_4_/  
> TURN\_SLIGHT\_RIGHT, /_5_/  
> CONTINUE, /_6_/  
> ENTER\_ROUNDABOUT, /_7_/  
> EXIT\_ROUNDABOUT, /_8_/  
> UTURN, /_9_/  
> FINISH, /_10_/  
> DEPART, /_11_/  
> KEEP\_LEFT, /_12_/  
> KEEP\_RIGHT, /_13_/  
> PT\_ENTER, /_14_/  
> PT\_TRANSFER, /_15_/  
> PT\_EXIT, /_16_/  
> UNKNOWN /_17_/;

```
public boolean isSlightLeftOrRight() {
    return this == TURN_SLIGHT_RIGHT || this == TURN_SLIGHT_LEFT;
}

```

}

Also on instruction-types.md U-Turn has a value of 9

| Value | Encoding |
| --- | --- |
| 0 | Left |
| 1 | Right |
| 2 | Sharp left |
| 3 | Sharp right |
| 4 | Slight left |
| 5 | Slight right |
| 6 | Straight |
| 7 | Enter roundabout |
| 8 | Exit roundabout |
| 9 | U-turn |
| 10 | Goal |
| 11 | Depart |
| 12 | Keep left |
| 13 | Keep right |

I could be wrong since I’m not familiar with this code, but I’d really appreciate your comments on this.

Best regards!!

---

<div class="post-metadata">

### Author: ![sascha](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/sascha/32/715_2.png) [@sascha](https://ask.openrouteservice.org/u/sascha)
#### Post date: [April 8, 2024, 7:50am UTC](https://ask.openrouteservice.org/t/u-turns-are-not-mentioned-on-the-instructions-steps/5851/11 "2024-04-08T07:50:38Z")

</div>

```auto
            case UTURN:
                return: 7;

```

is correct.
