>>>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.