# Extra\_info for directions

**URL:** https://ask.openrouteservice.org/t/extra-info-for-directions/1954
**Category:** directions
**Created:** [July 27, 2020, 11:55am UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954 "2020-07-27T11:55:27Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![EWouters](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@EWouters](https://ask.openrouteservice.org/u/EWouters)
#### Post date: [July 27, 2020, 11:55am UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/1 "2020-07-27T11:55:27Z")

</div>

Hi,

I checked in the API playground and it is supposed to return extra\_info like the osmid, but the only thing it returns is the name of the extra info parameter. How can I actually read the extra\_info attributes?

---

<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: [July 27, 2020, 11:59am UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/2 "2020-07-27T11:59:02Z")

</div>

Hi @EWouters,  
Could you please provide the request body and endpoint?

Best regards

---

<div class="post-metadata">

### Author: ![EWouters](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@EWouters](https://ask.openrouteservice.org/u/EWouters)
#### Post date: [July 29, 2020, 12:51pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/3 "2020-07-29T12:51:49Z")

</div>

You can reproduce this by requesting the osmid as extra info on /v2/directions/{profile} in the api playground.

cURL:

```auto
  curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: secret' \
  -d '{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]],"extra_info":["osmid"]}'

```

Response:

```auto
{"routes":[{"summary":{"distance":1369,"duration":292},"segments":[{"distance":887.8,"duration":189,"steps":[{"distance":312.6,"duration":75,"type":11,"instruction":"Head north on Wielandtstraße","name":"Wielandtstraße","way_points":[0,10]},{"distance":251.1,"duration":36.2,"type":1,"instruction":"Turn right onto Mönchhofstraße","name":"Mönchhofstraße","way_points":[10,21]},{"distance":212.2,"duration":50.9,"type":2,"instruction":"Turn sharp left onto Keplerstraße","name":"Keplerstraße","way_points":[21,24]},{"distance":109.9,"duration":26.4,"type":1,"instruction":"Turn right onto Moltkestraße","name":"Moltkestraße","way_points":[24,27]},{"distance":2,"duration":0.5,"type":0,"instruction":"Turn left onto Werderplatz","name":"Werderplatz","way_points":[27,28]},{"distance":0,"duration":0,"type":10,"instruction":"Arrive at Werderplatz, on the right","name":"-","way_points":[28,28]}]},{"distance":481.2,"duration":103,"steps":[{"distance":2,"duration":0.5,"type":11,"instruction":"Head south on Werderplatz","name":"Werderplatz","way_points":[28,29]},{"distance":265.5,"duration":63.7,"type":0,"instruction":"Turn left onto Moltkestraße","name":"Moltkestraße","way_points":[29,37]},{"distance":83,"duration":7.5,"type":0,"instruction":"Turn left onto Handschuhsheimer Landstraße, B 3","name":"Handschuhsheimer Landstraße, B 3","way_points":[37,39]},{"distance":130.8,"duration":31.4,"type":0,"instruction":"Turn left onto Roonstraße","name":"Roonstraße","way_points":[39,42]},{"distance":0,"duration":0,"type":10,"instruction":"Arrive at Roonstraße, straight ahead","name":"-","way_points":[42,42]}]}],"bbox":[8.681436,49.41461,8.690123,49.420514],"geometry":"ihrlHkr~s@S@}DHQ?OCs@IqAYQEQEyBa@SC?]?M?eA?S?W?SBuB@k@?a@AcH@[IBaJ~@O@A]YyFASC?B?CUEgAAWCUYyEASg@sI?CmAt@y@f@?BVlELpC","way_points":[0,28,42]}],"bbox":[8.681436,49.41461,8.690123,49.420514],"metadata":{"attribution":"openrouteservice.org | OpenStreetMap contributors","service":"routing","timestamp":1596026789767,"query":{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]],"profile":"driving-car","format":"json","extra_info":["osmid"]},"engine":{"version":"6.2.0","build_date":"2020-07-20T07:00:32Z","graph_date":"1970-01-01T00:00:00Z"}}}

```

Which does not have the osmids.

---

<div class="post-metadata">

### Author: ![EWouters](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@EWouters](https://ask.openrouteservice.org/u/EWouters)
#### Post date: [August 4, 2020, 1:49pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/4 "2020-08-04T13:49:36Z")

</div>

Hi @amandus, do you know if this is a bug?

---

<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: [August 4, 2020, 4:25pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/5 "2020-08-04T16:25:30Z")

</div>

@EWouters,  
It might be only activated for the wheelchair profile.  
@adam might be able to provide more info on this?

Best regards

---

<div class="post-metadata">

### Author: ![EWouters](https://ask.openrouteservice.org/letter_avatar_proxy/v4/letter/e/ecb155/32.png) [@EWouters](https://ask.openrouteservice.org/u/EWouters)
#### Post date: [August 5, 2020, 1:30pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/6 "2020-08-05T13:30:21Z")

</div>

@amandus after looking at the [ors-config-sample.json](https://github.com/GIScience/openrouteservice/blob/master/openrouteservice/src/main/resources/ors-config-sample.json#L335) in the repo it does seem to be the case that this is only enabled for the wheelchair profile.

I was able to run ors on my own server and it returns the osmid just fine for the other profiles if I enable it in app.config. I was just confused because in the api documentation it does not say this is only enabled for the wheelchair profile by default.

---

<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: [August 5, 2020, 1:37pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/7 "2020-08-05T13:37:50Z")

</div>

@EWouters,

glad you found it!  
Yes, there is always room for improvement in the documentation 😉  
I will add an issue.

Best regards.

---

<div class="post-metadata">

### Author: ![adam](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/adam/32/8_2.png) [@adam](https://ask.openrouteservice.org/u/adam)
#### Post date: [August 5, 2020, 1:40pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/8 "2020-08-05T13:40:58Z")

</div>

Just as a little info about why it is only there for wheelchair profile - it was developed as a prototype for a project that involved wheelchair routing where it was beneficial to return the different osm way ids along the route so that they could be used in allowing users to edit the base data in case of incorrect information. As it was a prototype it was not heavily optimised, so if it was to be run on a global profile with many edges (e.g. pedestrian) then it could potentially require a huge amount of hard disk and memory space.

---

<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: [August 5, 2020, 1:46pm UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/9 "2020-08-05T13:46:32Z")

</div>

> <https://github.com/GIScience/openrouteservice/issues/781>
>
> Regarding https://ask.openrouteservice.org/t/extra-info-for-directions/1954/6?u=…amandus
> \#### Here's what I did
> 
> \`https://api.openrouteservice.org/v2/directions/driving-car\`
> \`\`\`
> {"coordinates":\[\[8.681495,49.41461\],\[8.686507,49.41943\],\[8.687872,49.420318\]\],"extra\_info":\["osmid","surface"\]}
> \`\`\`
> 
> \---
> \#### Here's what I got
> 
> \`\`\`
> {"routes":\[{"summary":{"distance":1369,"duration":292},"segments":\[{"distance":887.8,"duration":189,"steps":\[{"distance":312.6,"duration":75,"type":11,"instruction":"Head north on Wielandtstraße","name":"Wielandtstraße","way\_points":\[0,10\]},{"distance":251.1,"duration":36.2,"type":1,"instruction":"Turn right onto Mönchhofstraße","name":"Mönchhofstraße","way\_points":\[10,21\]},{"distance":212.2,"duration":50.9,"type":2,"instruction":"Turn sharp left onto Keplerstraße","name":"Keplerstraße","way\_points":\[21,24\]},{"distance":109.9,"duration":26.4,"type":1,"instruction":"Turn right onto Moltkestraße","name":"Moltkestraße","way\_points":\[24,27\]},{"distance":2,"duration":0.5,"type":0,"instruction":"Turn left onto Werderplatz","name":"Werderplatz","way\_points":\[27,28\]},{"distance":0,"duration":0,"type":10,"instruction":"Arrive at Werderplatz, on the right","name":"-","way\_points":\[28,28\]}\]},{"distance":481.2,"duration":103,"steps":\[{"distance":2,"duration":0.5,"type":11,"instruction":"Head south on Werderplatz","name":"Werderplatz","way\_points":\[28,29\]},{"distance":265.5,"duration":63.7,"type":0,"instruction":"Turn left onto Moltkestraße","name":"Moltkestraße","way\_points":\[29,37\]},{"distance":83,"duration":7.5,"type":0,"instruction":"Turn left onto Handschuhsheimer Landstraße, B 3","name":"Handschuhsheimer Landstraße, B 3","way\_points":\[37,39\]},{"distance":130.8,"duration":31.4,"type":0,"instruction":"Turn left onto Roonstraße","name":"Roonstraße","way\_points":\[39,42\]},{"distance":0,"duration":0,"type":10,"instruction":"Arrive at Roonstraße, straight ahead","name":"-","way\_points":\[42,42\]}\]}\],"bbox":\[8.681436,49.41461,8.690123,49.420514\],"geometry":"ihrlHkr~s@S@}DHQ?OCs@IqAYQEQEyBa@SC?\]?M?eA?S?W?SBuB@k@?a@AcH@\[IBaJ~@O@A\]YyFASC?B?CUEgAAWCUYyEASg@sI?CmAt@y@f@?BVlELpC","way\_points":\[0,28,42\],"extras":{"surface":{"values":\[\[0,42,3\]\],"summary":\[{"value":3,"distance":1369,"amount":100}\]}}}\],"bbox":\[8.681436,49.41461,8.690123,49.420514\],"metadata":{"attribution":"openrouteservice.org | OpenStreetMap contributors","service":"routing","timestamp":1596634872093,"query":{"coordinates":\[\[8.681495,49.41461\],\[8.686507,49.41943\],\[8.687872,49.420318\]\],"profile":"driving-car","format":"json","extra\_info":\["osmid","surface"\]},"engine":{"version":"6.2.0","build\_date":"2020-07-20T07:00:32Z","graph\_date":"1970-01-01T00:00:00Z"}}}
> \`\`\`
> 
> \---
> \#### Here's what I was expecting
> 
> \`extras\` object to contain osm\_id
> 
> \---
> \#### Here's what I think could be improved
> Either add osm\_id to to all profiles
> or link in documentation to a map of which extra info is available for which profile.
> Currently it only states "The extra info items to include in the response"

The first suggestion will then probably not work with what adam said just now

---

<div class="post-metadata">

### Author: ![stefanct](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/stefanct/32/1702_2.png) [@stefanct](https://ask.openrouteservice.org/u/stefanct)
#### Post date: [May 31, 2022, 1:03am UTC](https://ask.openrouteservice.org/t/extra-info-for-directions/1954/10 "2022-05-31T01:03:05Z")

</div>

Hi,  
first some context: I am currently spitballing regarding improving the state of importing public transport routes. I am not aware of any truly automated (theoretical) setup that would be able to create OSM XML from GTFS data including existing ways. PTNA prepares GTFS data very well already ([example](https://ptna.openstreetmap.de/gtfs/DE/single-trip.php?feed=DE-S-und-U-Bahnen&release_date=&trip_id=3015.TA.92-A01-j22-1.32.R)) and even creates OSM XML for the relations including the platforms as members. However, it is missing the way IDs. By exploiting some routing engine to route between the platforms the relation would almost be complete (finding/adding stop\_position nodes would remain as the last/only task but that’s easy in comparison).

So I was checking if ORS could be part of the solution and was very happy to see the OSMID output parameter… till I found the (now available) [documentation](https://giscience.github.io/openrouteservice/documentation/extra-info/Extra-Info.html). If I understand correctly it would be possible to do this with a self-hosted solution but I am wondering if anything else has changed in the meantime (e.g., regarding optimizations etc) and if this will be enabled for other profiles in the foreseeable future.

cheers
