I have stored all locations (city's) from Germany, Switzerland and Austria (in all 17.000 records).
The stored information are:
 
LAT LONG FULL_NAME_ND
521.166.667 86.833.333 Aa-Bach
521.333.333 75.166.667 Aa-Bach
52.35 77.333.333 Aa-Bach
51.05 81.166.667 Aabach
514.833.333 87.333.333 Aabach Stausee
507.708.333 61.052.778 Aachen
507.672.222 60.916.667 Hauptbahnhof Aachen
507.538.889 62.419.444 Kreis Aachen
507.708.333 61.052.778 Kreisfreie Stadt Aachen
507.333.333 60.666.667 Aachener Stadtforst
508.166.667 61.666.667 Aachen-Merzbruck
507.666.667 61.333.333 Aachen-Rothe Erde
507.666.667 60.666.667 Aachen-West
497.833.333 66.333.333 Aacher Bach
 
What I like to present the customer is "how fare is it to Hauptbahnhof Achen from your location".
This is solved with this formula:
<@CALC EXPR="ACOS(SIN(@@User$LAT)*SIN(<@COLUMN 'Adressen.LAT'>) + COS(@@User$LAT)*COS(<@COLUMN 'Adressen.LAT'>)*COS(<@COLUMN 'Adressen.LONG'>-@@User$LONG)) * 6378,388" Precision="1">
 
Ps.: I know the exactly coordinates of the User, so the User$Var's are OK.
 
Also I like to present the distance, sorted from the short to the longest distance,
and to give the customer a chance to make a search like: "Show me all locations in a 50km radius from my point."
 
Normally, this is no problem if you have one fixed point from the start, but the start is not fix. Let say, one customer is located at "Aacher Bach" (like Chicago) and a other is from Aa-Bach (Austin)...
 
regards
 
Daniel
 
 
----- Original Message -----
From: Alan Wolfe
Sent: Sunday, October 31, 2004 8:23 PM
Subject: Re: Witango-Talk: Distance Calculations - Sort on..., search on...

how many locations do you have stored and why are you storing them if i may ask?
 
and what is it you are trying to present to the user?
 
That is, if this doesnt give away too much info that you dont want to share :P
 
just sometimes, good solutions to problems can be found be examining the situation as a whole, instead of just looking at the brick wall of the dead end you may currently be at you know?
----- 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 -----
From: Alan Wolfe
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

Reply via email to