johnnywang has asked for the wisdom of the Perl Monks concerning the following question:

Getting lazy about spherical geometry and looking for something quick and tested: given two points with longitude and latitude, find the distance in miles/feet/meters. Thanks.
  • Comment on Looking for module/code to compute distance using longitude and latitude

Replies are listed 'Best First'.
Re: Looking for module/code to compute distance using longitude and latitude
by dragonchild (Archbishop) on Apr 15, 2005 at 18:24 UTC
Re: Looking for module/code to compute distance using longitude and latitude
by hubb0r (Pilgrim) on Apr 15, 2005 at 18:26 UTC
    I think you're looking to use Math::Trig from cpan. It has a Great Cicle Distance calculation function. The link goes to the anchor for that function in the doc.
Re: Looking for module/code to compute distance using longitude and latitude
by Zaxo (Archbishop) on Apr 15, 2005 at 18:28 UTC
Re: Looking for module/code to compute distance using longitude and latitude
by polettix (Vicar) on Apr 15, 2005 at 19:10 UTC
    You can take a look to Geo::PROJ4 as well, but it requires you to install the PROJ4 library. I've googled for this kind of info some time ago, and I've found the PROJ4 library quite useful and accreditated.

    Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")

    Don't fool yourself.
Re: Looking for module/code to compute distance using longitude and latitude
by jonadab (Parson) on Apr 15, 2005 at 18:26 UTC

    Will Geo::Distance do what you want?

    (Caveat: I have not personally used or tested this module.)
Re: Looking for module/code to compute distance using longitude and latitude
by johnnywang (Priest) on Apr 15, 2005 at 18:34 UTC
    Thanks, I guess PM's fast responses are making google irrelavent:-)
      They have pigeons, we have monks :-)
      Thanks, I guess PM's fast responses are making google irrelavent:-)

      You do know about search.cpan.org, right? I have a bookmark keyword set for it so I can go to my browser's address bar and type something like "cpan distance" and hit enter and go straight to the results. Very handy.