Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

 Subscribe to receive our newsletter. Subscribe Unsubscribe

## Help me with distance calculate please

This is a discussion on Help me with distance calculate please within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all i am kind of new to mappoint, i need only the total distance between 2 latlong, (driving distance ...

1. Junior Member White Belt
Join Date
Nov 2007
Posts
1

## Help me with distance calculate please

Hi all
i am kind of new to mappoint, i need only the total distance between 2 latlong, (driving distance not air milage). i am using php and nuSOAP to call mappoint webserver by xml.
i am calling CalculateRoute but i get lots of information back which i dont use. which is all objects information of my direction.
which some times can be 600kb and it slow down my process alot becasue i only need a double or even int as my total distance.

any idea ???

2. Member Green Belt
Join Date
Feb 2005
Posts
52

## Re: Help me with distance calculate please

I once sought this, prior to having a GIS solution in an object model, but I figured here is a question I CAN answer here -heh.

You can compute this without using MapPoint, but I am not sure 'how' accurate it is considering the earth is not a perfect sphere, then again, I don't know how well MapPoint models the earth 'other' than 'as' a sphere.

Try here

Calculate distance and bearing between two Latitude/Longitude points using Haversine formula in JavaScript

I unfortunately lack the mathematics to fully comprehend how to derive this computation, but there are plenty of examples of this approach to calculating distance between two lat/lon pairs.

I do wonder if it would be appropriate to offset the distance by the % the earth's radius at the equator on its rotational axis increases to 'fix' the perfect sphere problem with this approach.

To those that have encountered this formula, it will be evident I'm not offering up as creative a solution as some of the black belts here - but glad I can actually help someone for once.

Tim Miltz

Quote yogi Beara I saw recently - good GIS one 'It is important to know where you are going, because you just might not get there if you don't'

3. ## Re: Help me with distance calculate please

That gives the "air distance" ('as the crow flies, or Great Circle distance) - not the road/route mileage.

Richard

4. Senior Member Black Belt
Join Date
Nov 2004
Location
Belgium
Posts
2,433

## Re: Help me with distance calculate please

Hi,

Originally Posted by kingvafa
Hi all
i am kind of new to mappoint, i need only the total distance between 2 latlong, (driving distance not air milage). i am using php and nuSOAP to call mappoint webserver by xml.
i am calling CalculateRoute but i get lots of information back which i dont use. which is all objects information of my direction.
which some times can be 600kb and it slow down my process alot becasue i only need a double or even int as my total distance.

any idea ???
There is a TotalDistance property in the route object. You dont need to parse to all the objects if I recall whell from the top of my head.

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•