Calculate Midpont?

Hi all! First time poster.

Looked through the API docs and I couldn’t find an answer to my question. Using the routing API, how can I find the halfway point along a route?

Thanks!

Time-wise - probably it could be calculated by combining the result with the output of Calculate Reachable Range endpoint.
Distance-wise - I do not see any easy solution.

I’ve gotten really close. I used calculateroute API to generate a list of points along the route. I then use a bit of javascript to calculate the distance difference between the origin and each point as well as the destination and each point. Then I take the difference of the differences. The one that’s closest to zero is the midpoint.

1 Like