Pdirection endpoint

Hi to all,

On https://maps.openrouteservice.org you can upload a GPX track to display the trail and get directions, with waypoints.
I’ve seen the endpoint /pdirection in the API call and the geocoding requests. But I couldn’t find any documentation, and nothing in the playground about this.

Can we use this endpoint? If yes, how?


I’ve take a look at the code https://github.com/GIScience/openrouteservice-app/tree/master/app/components/ors-panel-routing/ors-import-route

If I understand how it works, it starts by simplifying the geometry to get the waypoints and then there’s the call of the direction API with those waypoints.
It looks that there is no specific end point.

The route is then recalculated with these points, maybe depending on the profile it won’t take the same path.

Right or not?

Hi @gegeweb,

/pdirections is the endpoint for our public client that is restricted to ors internal usage.
It has the exact same functionality as the directions endpoint.

The conversion of the route works as you discovered.
We use the geometry points of the track and generate waypoints in defined intervals that can be specified with the deviation tolerance.
The smaller the value the more points are generated.
(it should only be possible to generate 50 waypoints maximum, but i somehow ****** up the implementation i just realized :expressionless:)

The generated points are send to our directions endpoint and a route is generated.

It is currently not possible to generate a route for an exact geometry with our backend.
So the closest you can get is:

  • import route
  • generate waypoints
  • adjust waypoints until it represents your route

best regards

OK, thanks for the reply.
I’m going to try in that way.