RE: [PHP] lat lon function
| From: | Bryan Lipscy | Date: | Tue, 08 Apr 2003 17:49:45 +0000 |
| Subject: | RE: [PHP] lat lon function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142930@lists.php.net to get a copy of this message | ||
Basic geometry. More appropriately triangulation.
The figure that you describe is a right triangle. Horizontal & vertical
components are 1 unit long. The diagonal would be the square root of 2.
The distance is equal to the sqrt(2) * 69 miles (length of one leg).
That distance can be somewhat misleading though because most likely you
would not be traveling in a straight line. Over long distances it is
even less accurate because of the curvature of the planet.
Bryan
-----Original Message-----
From: Edward Peloke [mailto:epeloke@echoman.com]
Sent: Tuesday, April 08, 2003 10:36 AM
To: Php-General@Lists. Php. Net
Subject: RE: [PHP] lat lon function
Don,
How would I get distance? If my search is for a place with a lat of 30
and long of 87 and I see a place with a lat of 31 and long of 88, how do
you get the rough distance?
Thanks,
Eddie
-----Original Message-----
From: Don Read [mailto:dread@texas.net]
Sent: Tuesday, April 08, 2003 12:51 PM
To: Edward Peloke
Cc: Php-General@Lists. Php. Net
Subject: RE: [PHP] lat lon function
On 08-Apr-2003 Edward Peloke wrote:
> Thanks, I will start to play with this, has anyone here done a query
> like this?
>
You could bracket the set of *possible* airports by :
SELECT ... FROM ...
WHERE lat BETWEEN latmin and latmax
AND lon BETWEEN lonmin and lonmax
The min/max values being calculated as 69 miles per
degree from the origin airport.
<snip>
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php