Re: Zip code
- From: "R. Rajesh Jeba Anbiah" <ng4rrjanbiah@xxxxxxxxxxxxxx>
- Date: 28 Jul 2005 08:42:32 -0700
News wrote:
> I have a database of zipcodes with latitude and longitude. I also have the
> method of calculating the distance between two zipcodes. What I want to
> know is if there is an efficient algorithm for obtaining the zip codes
> within a specified distance of the first zipcode without having to retrieve
> and calculate for every record in the database.
You may do that in the query itself; but the DB will definitely scan
all the records. Look at the previous discussions
<news:CWAVb.22832$VW4.3380@xxxxxxxxxxxxxxxxxxxxxxxxxx> (
http://groups-beta.google.com/group/comp.lang.php/msg/a1418b46576b2cd3
)
Indexing latitude and longitude might help.
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com
.
- References:
- Zip code
- From: News
- Zip code
- Prev by Date: Re: A question about efficiency
- Next by Date: Test for Interface membership
- Previous by thread: Re: Zip code
- Next by thread: Re: Zip code
- Index(es):
Relevant Pages
|