Estimated travel time using dbgeography

2

Is it possible to calculate the estimated travel time between two locations using dbgeography in C #?

    
asked by anonymous 21.06.2016 / 20:49

1 answer

2

It depends!

The class DbGeographyc does not was made for this. It allows you to work with points or shapes (poligons / shapes).

The only way you can calculate the time between two points is to know how far you can go in so long.

You may ask: What do you mean?

I'll explain.

With DbGeographyc you get only the distance between two points (usually in meters), for example:

var pointA = string.Format("POINT({1} {0})", latitude1, longitude1);  
var pointB = string.Format("POINT({1} {0})", latitude2, longitude2);

var distanceInMeters = pointA.Distance(pointB);  

From A to B has 4000m. If you travel 1000m in 10 minutes, you will travel the 4000m in 40 minutes. However, this calculation must be done manually by you.

  

It is worth mentioning that it does not give you the distance traveling streets / roads. It only returns you the distance between two points, nothing more.

    
21.06.2016 / 22:35