Extra_info for directions

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?

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

Best regards

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

cURL:

  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:

{"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.

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

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

Best regards

@amandus after looking at the ors-config-sample.json 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.

@EWouters,

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

Best regards.

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.

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

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) 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. 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