This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Get distances between adresses with VBA

0

Hello,

How can I query OSM to give me travel distances between adresses from access VBA?

regards

asked 22 Sep '19, 14:28

thedan85's gravatar image

thedan85
16112
accept rate: 0%


One Answer:

3

You cannot query OSM to do this, you need to query a routing engine. You can either install a routing engine yourself - open source software includes OSRM, Graphhopper, Valhalla - or you can use a routing engine run (and paid for) by someone else, for example the free offers on graphhopper.com (running Graphhopper) or routing.openstreetmap.de (running OSRM). These servers have usage policies and limits - it's ok to make a couple hundred queries for yourself but if you want to use it intensively or commercially, double-check what you are allowed to do.

Generally these servers will expect you to make a HTTP request and reply with a JSON message that you can then process in VBA. The precise formatting of the request and response depend on which routing engine you are using.

answered 22 Sep '19, 14:35

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 22 Sep '19, 14:37

Source code available on GitHub .