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

[c#] How to calculate distance and duration of travel between two points?

0

Hi,

I'm looking for a method to obtain the distance and duration travel between two point.

Starting from two addresses, I need to geocode them in order to get the latitude and longitude of both addresses and then calculate the distance (in km) and the duration ( in minutes) after defining the start and end point.

There is a way to get this kind of information in C#??

Thanks Fabio

asked 07 Apr '15, 10:14

Fabio's gravatar image

Fabio
11114
accept rate: 0%

edited 11 Apr '15, 01:24

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

Do you want to do this offline/locally or is accessing an online API an option?

(07 Apr '15, 10:20) AddisMap_Ale...

It doesn't matter, but I need to repeat this process for a large number of addresses. @AddisMap_Ale...

(07 Apr '15, 10:24) Fabio
(08 Apr '15, 14:08) aseerel4c26 ♦

2 Answers:

1

you mean a shortest? / fastest? route based on routing, don't you? See https://wiki.openstreetmap.org/wiki/Routing#Developers – libs and webservice APIs are available. If you use somebody's routing webservice you – of course – need to negotiate terms for your "large number of addresses" unless it is allowed by the service's usage policy.

answered 08 Apr '15, 13:58

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554
accept rate: 18%

edited 08 Apr '15, 14:07

1

... and about geocoding of addresses, see Search_engines

answered 08 Apr '15, 21:38

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Note: I guess the routing webservices would do the geocoding for the user.

(08 Apr '15, 23:45) aseerel4c26 ♦

Source code available on GitHub .