Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Sat, 8 Dec 2007 05:46:00 -0800,    group: microsoft.public.mappoint.webservice        back       


Find driving distance   
I would like to find the driving distances between 2 addresses.  I can get 
the geocode (lat/long) from the addresses using Find Service.  I don't need 
the actual route between the 2 addresses but I do need the shortest distance 
between them.  Is there a call for this.
Thanks,
Marc
date: Sat, 8 Dec 2007 05:46:00 -0800   author:   maa

RE: Find driving distance   
Marc,

There has to be latitude/longitude pair in order to calculate a distance 
between two points.  What other information do you have about these 
locations?  If you have address information, you can reverse geocode it into 
latitude/longitude using the FindServiceSoap.GetLocationInfo method:
http://msdn2.microsoft.com/en-us/library/aa492585.aspx

Hope that helps,
-- 
Infusion Development
http://www.infusiondev.com


"maa" wrote:

> I would like to find the driving distances between 2 addresses.  I can get 
> the geocode (lat/long) from the addresses using Find Service.  I don't need 
> the actual route between the 2 addresses but I do need the shortest distance 
> between them.  Is there a call for this.
> Thanks,
> Marc
date: Mon, 10 Dec 2007 08:01:01 -0800   author:   Derek Chan

RE: Find driving distance   
Hi Marc

You can find the distance between two lat/longs by getting the route. I know 
you stated that you don't need the actual route, and you don't have to use 
it, but it is the route that will determine the driving distance between two 
points. 

To do this, you call the CalculateSimpleRoute method off of the 
RouteServiceSoap web service, like this:

LatLong[] routePoints= new LatLong[2];
routePoints[0] = new LatLong();
routePoints[0].Latitude = 40;
routePoints[0].Longitude = -120;
routePoints[1] = new LatLong();
routePoints[1].Latitude = 41;
routePoints[1].Longitude = -121;

Route route = routeService.CalculateSimpleRoute(routePoints, "MapPoint.NA", 
SegmentPreference.Shortest);

The parameter called routePoints is just a collection of lat/longs (starting 
and ending location). "MapPoint.NA" defines the data source, and 
SegmentPreference.Shortest can be set to Shortest, Quickest, or 
PreferredRoads. 

Once you have your route, the distance is found off of the Itinerary object, 
which is a property of the route object, like this:

string distance = route.Itinerary.Distance.ToString();

More info can be found at: 
RouteServiceSoap: http://msdn2.microsoft.com/en-us/library/aa502471.aspx
Route object: http://msdn2.microsoft.com/en-us/library/aa502468.aspx
RouteInterary object: http://msdn2.microsoft.com/en-us/library/aa502469.aspx

- FlyboyWhite
http://dotnetadvantage.blogspot.com/



"maa" wrote:

> I would like to find the driving distances between 2 addresses.  I can get 
> the geocode (lat/long) from the addresses using Find Service.  I don't need 
> the actual route between the 2 addresses but I do need the shortest distance 
> between them.  Is there a call for this.
> Thanks,
> Marc
date: Mon, 17 Dec 2007 14:03:54 -0800   author:   FlyboyWhite

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us