Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MATH - getting rows within a radius
Message
De
26/04/2007 18:02:05
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
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:
01220269
Vues:
21
>>>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?
>>
>>The simplest (combining database and maths) would be to select those which fall into a square of the same size - i.e. which differ north/south and east/west by no more than a given radius - that should reduce the number of hits with a single simple SQL call. Then among those, exclude any where N/S distance squared plus E/W distance squared is larger than your radius squared. The remaining guys are in your radius.
>
>This is the most efficient way to do it when dealing with a lot of geographic records.
>
>I've done it before for a radio frequency coordination application when finding radio transmitters w/in certain radius of a station on a given frequency. The transmitter database had over 6 million records (in VFP table).
>
>Pulling a subset of data based on a 'box' bounded by lat and lon lines that were the desired distance out made final determination of distances and elimination of records outside the radius MUCH faster than determining distance as part of the initial select. I did use a great-circle distance calculation rather than hypotenuse because some of the searches involved long distances.

I figured that he's still in the crime business, so he'd need anything within a drivable distance, or within one jurisdiction, where the difference between the arc and the tendon distance is negligible.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform