GraphHopper.com | Forum | GitHub | Maps | Blog

IllegalArgumentException Cannot find from_points


#1

Hi,

I’m trying to benchmark GH matrix api against other distance providers.
I have random point generated with 5 digits precisions. The points can be everywhere has they are generated randomly within France.

Sometimes I receive error 400 IllegalArgumentException Cannot find from_points:0
like in this request
https://graphhopper.com/api/1/matrix?from_point=44.94513,6.09234&to_point=45.22504,5.79254&type=json&vehicle=car&out_array=times&out_array=distances&key=YOURKEY

I would like Graphhopper to take the closest road to that point, like other providers do. Although, putting the 2 points in OSM, using graphhoper as routing engine, there is a result, and we can see that the lat and long have shift in the result url :
https://www.openstreetmap.org/directions?engine=graphhopper_car&route=44.98208%2C6.12377%3B45.22621%2C5.79126#map=11/45.1045/5.9067

I understand that if there are no road in the GH network, it is hard to compute a distance and duration. The problem is that the application I work on, is used by electricity wire company, and the point location may really be in the middle of a field or forrest. Te techniciens will walk the last meter by foot if no road exists, so I need the distance and duration at the closest street.
Tell me if it is possible or when it will be.

Regards,


#2

This is an interesting problem, thanks!

It will do so. But at some point we have to return an error and so we do not allow snapping more than approx. 1.5 kilometers away.

Te techniciens will walk the last meter by foot if no road exists, so I need the distance and duration at the closest street.

You’ll need to find a different solution for the usual Directions API as we won’t change this strict behaviour (in a custom setup everything like a bigger snapping radius is possible though)

The best thing would be if we could internally do this multi modal routing, but this is rather complex and won’t happen soon for the Matrix API

Although, putting the 2 points in OSM, using graphhoper as routing engine, there is a result,

OSM uses the same API endpoint like GH maps so this must be some geocoding or UI thing that influences the snapping. (see the different coordinates)