Thursday, February 23, 2012 12:19 AMHello everyone,
I am developing a small application that uses the latitude and longitude to calculate the distance between points.
I am using the following formula within a stored procedure and it works ok.
set @resultado =ACOS(SIN(RADIANS(@latitude_origem))*SIN(RADIANS (@latitude_destino))+COS(RADIANS(@latitude_origem))*COS(RADIANS(@latitude_destino))*COS(RADIANS(@dif_Longitude)))
With the formula above, the distance is calculated directly.
I've been researching applications that allow to define routes and found thefollowing web services:
Application Using Bing MapsSOAP Services
My question is whether it is possible to obtain a route with the distance between twoor more coordinates, and if the route is drawn based on the shortest path.
Point LONGITUDE LATITUDE
A -8,750486 41,3559
B -8,606915 41,15467
C -8,631134 41,15847
D -8,766627 41,40691
distances obtained results of the formula
If possible using the Bing MapsSOAP Services,
is to confirm the results and see what the differences to the
formula obtained using only the coordinates.
It is possible to obtain the distance between more than two points,
for examplepassing through all points.
I use this code to obtain de address with coordinator
string results = "";
string key = "”;
ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();
reverseGeocodeRequest.Credentials = newGeoCodeService.Credentials();
reverseGeocodeRequest.Credentials.ApplicationId = key;
// Set the point to use to find a matching address
GeoCodeService.Locationpoint = newGeoCodeService.Location();
- Moved by Richard_BrundrittMicrosoft Employee, Owner Friday, March 16, 2012 6:41 PM (From:Bing Maps: Map Control and Web services Development)
Thursday, February 23, 2012 12:55 PM
yes given two points, you can use RouteService provided by Bing maps / Virtual Earth. The route service requires two coordinates and additional params that denoted whether you want Shortest time / distance with or without traffic info etc.
The result contains distance and legs. each leg containing info on the distance and time it will take etc in addition to other things.
RouteResult Class http://msdn.microsoft.com/en-us/library/cc981078.aspx
RouteSummary Class http://msdn.microsoft.com/en-us/library/cc980859.aspx
Route Service http://msdn.microsoft.com/en-us/library/cc966826.aspx
Here's an example for Windows phone. There is another microsoft working sample that provides route info from
- Marked As Answer by Richard_BrundrittMicrosoft Employee, Owner Monday, February 27, 2012 11:28 AM
Monday, February 27, 2012 9:26 PM
For your help.