Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MATH - getting rows within a radius
Message
De
26/04/2007 13:32:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01219992
Message ID:
01220205
Vues:
16
>>>I have a table of warrants with latitude and longitude, and I would like to be able to select all warrants within a given radius. I know I've seen this discussed before. Any of you math professors got a clue?
>>
>>GIYF: http://www.google.ca/search?q=lat+long+distance+between+points
>
>I didn't see anything about pulling records within a given radius....

To expand on Hilmar's response you could do something like
SELECT ;
  ... ;
  FROM Warrants ;
  WHERE DistanceBetween( StationLat, StationLong, WarrantLat, WarrantLong ) <= SomeDistance ;
  ...

FUNCTION DistanceBetween( StationLat, StationLong, WarrantLat, WarrantLong )

* Maths as per Google link(s)
...

RETURN Distance
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform