Given a database of GPS points, a center GPS location, and a radius R (in meters), how can I find all points in the database that are within a distance of R of the center point? Will the distance iso-lines be an ellipse?
|
|
For such short distances and since you are doing the coding yourself, the flat earth equations would probably be a good enough approximation but it depends on your accuracy requirements. Compute the distance from latp,lonp to lat1/lon1 via the equirectangular projection:
Latp/Lonp will be your reference lat/lon (in radians!). Lat1/Lon1 will be the point you are testing. Once you have distance, it is an easy test to determine if the point lies within your circle. Reference: section Equirectangular approximation at the site: http://www.movable-type.co.uk/scripts/latlong.html |
||||
|
|
|
For a spherical earth I have found that the formulas in the Aviation Formulary. For the distances you are working these distance calculations are more than adequate. Unless of course your GIS package includes these calculations, or tools to select by buffering and intersecting. |
|||
|
|
|
Vincenty's formulae devised by Thaddeus Vincenty is also worth it. You can head to the page entitled Vincenty formula for distance between two Latitude/Longitude points. Other implementations: |
|||
|
|
