MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Distances 'as the crow flies'

This is a discussion on Distances 'as the crow flies' within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; How do I calculate the straight line distances between two locations?...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-16-2007
TRK TRK is offline
Junior Member
White Belt
 
Join Date: Jan 2007
Posts: 1
Distances 'as the crow flies'

How do I calculate the straight line distances between two locations?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2007
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 122
Smile Re: Distances 'as the crow flies'

Try googling for "Great Circle Distance"

An implementation using latitude/longitude points in VB.Net would be:
Calculate Distance and Radius in VB.NET - Visual Basic , VB.NET
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-19-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Distances 'as the crow flies'

Hi,

Here is a code sample in Delphi:

Code:
function TRefPoints.GetDistance(Lat1, Lon1, Lat2, Lon2: double): integer;
var
   Lat, Lon, Dist: double;
begin
   Lat := Lat2 - Lat1;
   Lon := (Lon2 - Lon1) * Cos(DegToRad((Lat1 + Lat2) / 2));
   Dist := Hypot(Lat, Lon);
   Result := Round(Dist * 1.852 * 60000); // meters
end;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-19-2007
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 122
Re: Distances 'as the crow flies'

Of course, since this is MapPoint we're dealing with...
Look at the methods

Map.Distance(Loc1,Loc2)
and
Location.DistanceTo(Loc)

Can't believe I didn't mention this in my first reply.
[Slaps head]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 01-20-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Distances 'as the crow flies'

Hi Paul,

Agreed, but the latter is very slow. If it is needed to do many calcultions at once then own written is mutch faster.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/distances-crow-flies-5598.html

Posted By For Type Date
A More Compact Method for Obtaining Lat/Long - MapPoint Articles - MP2K Magazine This thread Refback 01-17-2007 03:19 PM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 01-17-2007 08:23 AM
The Magazine for MapPoint - MP2K Magazine This thread Refback 01-16-2007 04:30 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Getting Distances cmarquez MapPoint 2006/2009 Discussion 13 10-17-2006 09:34 AM
Calculate distances Anonymous MapPoint 2006/2009 Discussion 1 11-18-2004 10:58 AM
Batch Distances?! Anonymous MapPoint 2006/2009 Discussion 0 01-21-2004 12:40 PM
Calculating distances from a route Anonymous MapPoint 2006/2009 Discussion 0 07-18-2003 11:23 AM
hi, we are using mappoint to get distances for ou.... Anonymous MapPoint 2006/2009 Discussion 3 07-05-2002 10:01 AM


All times are GMT -5. The time now is 05:25 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Flights to Tunisia
Experience the cultural mix of Tunisia yourself. Visit their impressive historical sites and delicious cuisine. Visit us online to get great value flights to Tunisia.

Best Travel Agent
Travel Counsellors has been named the UK's Best Travel Agent at the Guardian Unlimited Travel awards.

Holidays to Jamaica
At dealchecker.co.uk, we'll shop around for cheap holidays to Jamaica so you don't have to. We search deals from the UK’s top holiday companies all in one go. Try it for free.

Cyprus Holidays
Cyprus holidays will offer you a wealth of activities all in the most beautiful surroundings. Relish the beauty of Cyprus on a short break.

Cyprus
Before visiting Cyprus, make sure you are well informed to make the most of your holiday. Online at ulookubook.com you check out our useful travel guides. Find out all about the Cyprus nightlife, shopping, eating and customs.

Price Comparison
Price comparison is the name of the game at Travel.co.uk. Visit our website and see for yourself.

Holidays in Goa
Want to know more about Indian culture? Visit On The Beach for information on holidays in Goa.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51