Helpful Information
 
 
Category: Software Design
GPS / GIS algorithm

Does anybody know the best way to use GPS data or GIS data to figure out what places are within X km/miles of a given coordinate, and how far from the given coordinate they are?

This looks like it would be an incredibly expensive calculation, as you'd need to calculate the area of the bounded region, and then find all places within this bounds. You'd then need to work out the distance form the center of the bounded region to each point.

Is there another, simpler way (with less overhead)?

In abstract, this problem sounds identical to this:
http://forums.devshed.com/showthread.php?s=&threadid=30984&forumid=43

And again, the solution lies in improving the datastructure. If you can organize the places in for example boxes (buckets), then you can greatly speed up the computation.

There might be some useful links or ideas here as well:

http://forums.devshed.com/showthread.php?threadid=16926&forumid=4

You definitely don't need to calculate the area of the bounded region or anything like that. It's not really that difficult to do, but to get accurate measurements, you need to convert to spherical coordinates.

I implemented this exact method at www.anisite.com (click on a state on the map, and you will get tower location points on a zoomable map, with a drop-down in the right-hand side that shows a radius search, with relative distances from the center of your last map-click)

If you use the right formula, there is very little performance hit on your system. In fact, at one time I even implemented the radius search in Javascript, and it worked fine processing hundreds of coordinates.

I got the basic formula from the "Ask Dr. Math" (http://mathforum.org/dr.math/ ) forum. See the following links for the answer:
http://mathforum.org/dr.math/problems/longandlat.html
http://mathforum.org/dr.math/problems/hollingshead12.11.97.html
http://mathforum.org/dr.math/problems/atlas5.21.96.html

This question has been asked so many times that there are many more links at the forum. Do a search for "Spherical coordinate search", and you will see.

Greetings,

My inquiry is further to the one mentioned above or in any of the provisioned links. I seek details of the methodology for representing two points with respect to each other, known by their unique GPS coordinates, on a plain blank screen.

Any pointers to known implementations or code (preferably in Python) would be greatly appreciated.

Best regards,
wirefree










privacy (GDPR)