Technically yes. But then you have to run through a db to scan for each latitude/ longitude and calculate the distance. What I am trying to do is to avoid this. If I know what latitudes/longitudes I have to scan for say 10001, it would be nice to know that I would search in direction of Jersey city rather than searching for places in Upstate NY. That way I am already avoiding a query on so many rows. I know most would argue that searching through db these days doesnt take a lot of time with the computing power we have, but I was still looking for something optimized rather than check all.
I have DB of all zip codes and I am using that to calculate it but as I said, I would want to avoid searching 30 odd thousand records every time On Thu, May 14, 2009 at 12:37 AM, Hari haran <[email protected]>wrote: > I dont know if it could help, but can you not achieve the same by having > latitutes and longitudes as a basic paramater to compute? > > Coz to compute we need to have some base data to work on... > > Let me know if this can work or give me inputs... > > -Hari > On Thu, May 14, 2009 at 9:12 AM, Subrato Mukherjee < > [email protected]> wrote: > >> Yes I believe I could use enum or anything. But I really would like to >> compute it. >> Subrato >> >> >> On Wed, May 13, 2009 at 11:21 PM, Vivek SHANTHARAM >> <[email protected]>wrote: >> >>> Since I the know the data beforehand and it is fixed , say 50 states, i >>> would put it in an enum and access it. >>> >>> And of course, computing it would be brilliant. >>> >>> On Thu, May 14, 2009 at 7:00 AM, S <[email protected]> wrote: >>> >>>> >>>> I am developing this small application in which I need to find states >>>> adjacent to the one I am looking up. Say for example, if I am looking >>>> up Connecticut, adjacent ones are NY, MA. Now I could potentially >>>> store it but I would want to rather compute it and do it very >>>> efficiently. >>>> >>>> Any ideas anyone can throw on this ? >>>> >>>> Thanks >>>> S >>> >>> >>> >> >
