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
270 stars 26 forks source link

Local OSRM distances Matrix not working #6

Closed mesax1 closed 4 years ago

mesax1 commented 4 years ago

Here's what I did

from routingpy.routers import OSRM

router = OSRM(requests_kwargs={'proxies': {'https': '129.125.12.0'}}) client = OSRM(base_url='http://localhost:5000') Matrix=OSRM.matrix(client, locations=addresses, profile='car', dry_run=True)

dry_run results: url: http://localhost:5000/table/v1/car/-75.567589,6.191159;-75.558888,6.2834;-75.554428,6.303507;-75.508671,6.342607;-75.571788,6.174933;-75.566615,6.184022? Parameters: { "headers": { "User-Agent": "routingpy/v0.2.7", "Content-Type": "application/json" }, "timeout": 60 }

Here's what I got

Matrix.durations worked correctly, but Matrix.distances is completely empty.


Here's what I was expecting

I was expecting Matrix.durations and Matrix.distances to be acquired, but only received Matrix.durations.

Here's what I think could be improved

If annotations='distance,duration' could be used as default, instead of only 'duration', I think we should be able to get both the durations and distances matrices.

nilsnolde commented 4 years ago

Ok, got ya. Wanna have a stab at a PR? :innocent:

Didn't look at OSRM in a longer while.. But this seems to make sense, as it's the standard setting for routing-py to have both returned.