[6099] Unable to compute distance/duration matrix foot-walk

Hi, I’ve been using the matrix endpoint but am experiencing a 6099 “Unable to compute a distance/duration matrix.” error with certain coordinates and walking mode. For example this fails with the 6099 error:

curl --location --request POST 'https://api.openrouteservice.org/v2/matrix/foot-walking' \ --header 'Authorization: <KEY>' \ --header 'Content-Type: application/json' \ --data-raw '{"locations": [[-3.227298693697719,51.97143087679216],[-3.228480761471288,51.96048889326853]], "metrics": ["distance", "duration"], "sources": [0], "units": "km"}'

But as a standard route it works fine:
https://api.openrouteservice.org/v2/directions/foot-walking?start=-3.227298693697719,51.97143087679216&end=-3.228480761471288,51.96048889326853&api_key=

Any pointers appreciated.

1 Like

Hey,

I can indeed reproduce your issue. However, when running ors locally and issuing the same command, it somehow works:

$ curl --location \
       --request POST 'http://localhost:8082/ors/v2/matrix/foot-walking' \
       --data-raw '{"locations": [[-3.227298693697719,51.97143087679216],[-3.228480761471288,51.96048889326853]], "metrics": ["distance", "duration"], "sources": [0], "units": "km"}' 
$                                      
{"durations":[[0.0,1393.63]],
 "distances":[[0.0,1.94]],
 "destinations":[{"location":[-3.227349,51.971397],"snapped_distance":5.08},{"location":[-3.22845,51.960504],"snapped_distance":2.68}],
 "sources":[{"location":[-3.227349,51.971397],"snapped_distance":5.08}],
 "metadata":{"attribution":"openrouteservice.org, OpenStreetMap contributors","service":"matrix","timestamp":1670946472683,"query":{"locations":[[-3.227298693697719,51.97143087679216],[-3.228480761471288,51.96048889326853]],"profile":"foot-walking","responseType":"json","sources":["0"],"metrics":["distance","duration"],"units":"km"},"engine":{"version":"6.8.0","build_date":"2022-12-13T15:40:53Z","graph_date":null}}
}

However, the data returned differs quite a bit from the data returned by the directions-request:

{"distance":1628.4,"duration":1172.5}

I am indeed a bit stumped, I’ll open an issue for this.

Best regards

2 Likes

In case it helps, I have experienced the same issue since last week. The matrix API keeps working for ‘cycling-regular’ and ‘driving-car’ but not for ‘foot-walking’. I also attach the whole trace:

coord_list (placed in Madrid, Spain)
[[-3.6649962, 40.3877979], [-3.6911267, 40.4111064], [-3.6974563, 40.4143821], [-3.6955643, 40.4142242], [-3.6989, 40.46864], [-3.7003923, 40.4155336], [-3.6941315, 40.4152642], [-3.6982156, 40.4151342], [-3.7014378, 40.4135091], [-3.6972714, 40.3915129], [-3.692170399999999, 40.4198825], [-3.6998098, 40.4165266], [-3.699169, 40.4124961], [-3.6949254, 40.4160406], [-3.6921271, 40.4137818], [-3.6945569, 40.4079123], [-3.689402, 40.423553], [-3.7219663, 40.4383189], [-3.7109397, 40.4269963], [-3.6876175, 40.433083], [-3.6915271, 40.425072], [-3.7007766, 40.4256895], [-3.7255938, 40.42538649999999], [-3.7072444, 40.4129464], [-3.717769499999999, 40.4240216], [-3.6825368, 40.4110538], [-3.714552, 40.415651], [-3.71908, 40.42154], [-3.7115755, 40.4200462], [-3.714311999999999, 40.417955], [-3.688737, 40.419992], [-3.7038168, 40.4223775], [-3.6883337, 40.4530387], [-3.7110023, 40.4121475], [-3.7037974, 40.4164102], [-3.6930825, 40.4193326], [-3.728866, 40.4400802], [-3.6857512, 40.4369187], [-3.687918, 40.4767085], [-3.689709299999999, 40.4409237], [-3.7062018, 40.4182354], [-3.683607, 40.40617049999999], [-3.7227934, 40.4139658], [-3.7145483, 40.4104996], [-3.6925026, 40.4353663], [-3.710578, 40.418299], [-3.6632793, 40.4329957], [-3.6999898, 40.4552384], [-3.6884395, 40.4667632], [-3.697729899999999, 40.4322745], [-3.6944076, 40.4186253]]
foot-walking


ApiError Traceback (most recent call last)
Cell In[14], line 44
41 print(coord_list)
42 print(TRANSPORT_PROFILE)
—> 44 poi_matrix = ors_client.distance_matrix(
45 locations=coord_list,
46 profile=TRANSPORT_PROFILE,
47 metrics=[‘distance’, ‘duration’],
48 validate=True,
49 )
51 if poi_matrix is not None:
52 process_matrix_mdb(poi_list, poi_matrix)

File C:\software\anaconda3\envs\ox\lib\site-packages\openrouteservice\client.py:326, in _make_api_method..wrapper(*args, **kwargs)
323 @functools.wraps(func)
324 def wrapper(*args, **kwargs):
325 args[0]._extra_params = kwargs.pop(“extra_params”, None)
→ 326 result = func(*args, **kwargs)
327 try:
328 del args[0]._extra_params

File C:\software\anaconda3\envs\ox\lib\site-packages\openrouteservice\distance_matrix.py:118, in distance_matrix(client, locations, profile, sources, destinations, metrics, resolve_locations, units, optimized, validate, dry_run)
115 if optimized is not None:
116 params[“optimized”] = optimized
→ 118 return client.request(
119 “/v2/matrix/” + profile + “/json”,
120 {},
121 post_json=params,
122 dry_run=dry_run,
123 )

File C:\software\anaconda3\envs\ox\lib\site-packages\openrouteservice\client.py:225, in Client.request(self, url, get_params, first_request_time, retry_counter, requests_kwargs, post_json, dry_run)
215 return self.request(
216 url,
217 get_params,
(…)
221 post_json,
222 )
224 try:
→ 225 result = self._get_body(response)
227 return result
228 except exceptions._RetriableRequest as e:

File C:\software\anaconda3\envs\ox\lib\site-packages\openrouteservice\client.py:271, in Client._get_body(response)
269 raise exceptions._OverQueryLimit(status_code, body)
270 if status_code != 200:
→ 271 raise exceptions.ApiError(status_code, body)
273 return body

ApiError: 500 ({‘error’: {‘code’: 6099, ‘message’: ‘Unable to compute a distance/duration matrix.’}, ‘info’: {‘engine’: {‘version’: ‘6.8.0’, ‘build_date’: ‘2022-10-21T14:34:31Z’}, ‘timestamp’: 1670964752220}})

As alternative option I am using Directions API for ‘foot-walking’ queries. Thanks in advance.