gis-ops / routingpy

🌎 Python library to access all public routing, isochrones and matrix APIs in a consistent manner.
https://routingpy.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
251 stars 26 forks source link

Support Graphhopper's POST Route Endpoint #90

Closed jan-bausch closed 1 year ago

jan-bausch commented 1 year ago

Graphhopper supports both a GET and a POST directions endpoint. However, the GET endpoint has some limitations:

For the GET request you specify the parameters in the URL and can try it directly in every browser. However, it has some disadvantages when using many points (URL length limit) and the custom_model Feature cannot be used. Therefore, our recommended endpoint is the POST route endpoint.

(Quote from the Graphhopper docs)

Currently, routingpy only supports the GET endpoint. It would be cool to use POST, to be able to set custom models!

nilsnolde commented 1 year ago

Jep right. They must've added POST a while ago. They went through 6 major versions in the past 2 years, can't keep up with that;)

We hardly ever work with Graphhopper, but would appreciate a PR fixing it.

jan-bausch commented 1 year ago

Do you prefer

a) replacing the GET with the POST request alltogether, or b) adding an optional parameter to use the POST endpoint?

jan-bausch commented 1 year ago

Intuitively, I'd go for a), as the endpoints should be interchangeable. What's your opinion?

nilsnolde commented 1 year ago

Do you think GET is interesting for any scenario? Is there an action that's GET only or so? Valhalla has both too, but we only do POST since there's not GET-only ones. It'd be easiest here too IMO.

jan-bausch commented 1 year ago

I agree 👍 Based on the docs, there are no drawbacks, and POST is clearly recommended.

jan-bausch commented 1 year ago

I can work on a small PR, if I find the time 👌

jan-bausch commented 1 year ago

Created https://github.com/gis-ops/routingpy/pull/91

jan-bausch commented 1 year ago

Any chance for a quick review, @nilsnolde ?

nilsnolde commented 1 year ago

was done in #91 & #92 , thanks again:)