Number of Users: between 1.500 an
20.000
Number of locations: Over 17.000
Used Database: MySQL
Storing the data's is not possible. Each user have
a different start-point. See my prev. mail.
Do the calculation inside the database will be
possible, but then I must stored the result a new table. Only on 5
calcs, I have several thausend records, so...
Views: I'm not sure, if MySQL support views. If
yes, it would be fine
regards
Daniel
----- Original Message -----
Sent: Sunday, October 31, 2004 8:35
PM
Subject: Re: Witango-Talk: Distance
Calculations - Sort on..., search on...
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
----- Original Message -----
Sent: Sunday, October 31, 2004 11:18
AM
Subject: Re: Witango-Talk: Distance
Calculations - Sort on..., search on...
Alan,
stored is only the altitude and longitude. So,
no more informations. The rest is calculated.
rs
daniel
----- Original Message -----
Sent: Sunday, October 31, 2004 7:40
PM
Subject: Re: Witango-Talk: Distance
Calculations - Sort on..., search on...
Hi Richard,
How is the list of locations generated and
what do they represent? how are you using them in your
program?
Just wondering, why is it you want to store
the formula-text in the database? If the database gave you the
answer instead of the formula, would you still need the text of the
formula?
----- Original Message -----
Sent: Sunday, October 31, 2004
10:22 AM
Subject: Witango-Talk: Distance
Calculations - Sort on..., search on...
Distance Calculation is no problem, that
works. Here the formula:
<@CALC EXPR="ACOS(SIN(@@User$Breite_1)*SIN(<@COLUMN
'Adressen.Geo_Breite'>) + COS(@@User$Breite_1)*COS(<@COLUMN
'Adressen.Geo_Breite'>)*COS(<@COLUMN
'Adressen.Geo_laenge'>-@@User$Laenge_1)) * 6378,388" Precision="1">
The problem what I have is:
1) To do a sort of the result (OK, I can do
it in a array, but this need to much RAM [more as 2500 records, nearly
50x on one time])
2) To do a search in a specified area like
"show me all points near x miles(km).
One way what make sense is to store the
formula in the database, but
- if i make a assign to a variable, then
Witango store only the result. What I like to store is the
formula-text:
Second problem: I can't do a sort on the
stored formula (Sort command: <@COLUMN 'Adressen.formel'
Encoding="Metahtml">)
Any Successions ?
THX for help
regards
Daniel
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
|