|
I guess without more information here's the best
solution that i see...
depending on number of users you have and number of
locations they are looking at, it might be best to store the distances to each
location the user cares about in the database (calc'ing them at some point) and
then just sort that way. calculating distance for alot of locations at one
time is going to be alot of CPU and will take a long time no matter how you calc
them (i am a game programmer on the side and deal w/ these kinds of problems all
the time, if at all possible, pre-calculating distance and storing it is the way
to go in alot of situations). If the user is in a position to where they
would be able to "relocate" themselves, if feasible, you could just recalculate
the distances at the time they locate.
I think by far the best solution would be to store
the data in the database if possible.
If not possible, if you have few enough locations,
you could calculate distances on the fly, but if possible, having the database
calculate the distance instead of witango since most databases seem to be better
at doing massive amounts of math at a time then witango is.
another thing you could do is if your database
supported views you could create a view where one of the columns on the view is
the distance of the location, and then you could select data from the view and
do sorts etc.
with more information, we could probably give
better help but dont know if you would be giving away "proprietary secrets" or
not to do so :P
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf |
- Re: Witango-Talk: Distance Calculations - Sort on..., se... Alan Wolfe
- Re: Witango-Talk: Distance Calculations - Sort on..... [EMAIL PROTECTED]
- Re: Witango-Talk: Distance Calculations - Sort on..... Alan Wolfe
- Re: Witango-Talk: Distance Calculations - Sort ... [EMAIL PROTECTED]
- Re: Witango-Talk: Distance Calculations - Sort on..... Jonah Simpson
- Re: Witango-Talk: Distance Calculations - Sort ... Alan Wolfe
- Re: Witango-Talk: Distance Calculations - Sort ... [EMAIL PROTECTED]
- Re: Witango-Talk: Distance Calculations - S... John McGowan
- Re: Witango-Talk: Distance Calculations - S... Alan Wolfe
- RE: Witango-Talk: Distance Calculations - Sort on..... Ben Johansen
- RE: Witango-Talk: Distance Calculations - Sort ... Ben Johansen
- RE: Witango-Talk: Distance Calculations - S... Ben Johansen
- Re: Witango-Talk: Distance Calculations... [EMAIL PROTECTED]
