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
Results 1 to 5 of 5

Distances 'as the crow flies'

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

  1. #1
    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?

  2. #2
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Location
    Battle Creek, Michigan
    Posts
    136

    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

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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;

  4. #4
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Location
    Battle Creek, Michigan
    Posts
    136

    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]

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

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

Tags for this Thread

Posting Permissions

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


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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96