Hi,
I'm trying to store a database of GPS locations and run queries which find the points within a given radius and also the closest points. I'm using mysql and have been looking at the spatial extensions. I am not sure if i see how to actually use the spatial extensions to do what I'm looking for in the location radius queries.
So here is what im thinking for my options:
Store the lat and long gps coordinates as float indexed variables in the db. When i get a point gps coordinate and a range, calculate the max and min lat and long values to query for and then sort based on a distance function within these to order.
Use the spatial extension. I'm not quite positive that this will work. The Distance() function is not implemented. Using a spatial index requires finding a bounding box (doable) and calling the MBRContains bounding box function to find the points that are in this bounding box. However a point has a boundary of zero so the MBRContains function doesnt work on points.
I'm not sure what the standard way to do this is (it doesnt seem like there is one) and would greatly appreciate any words of experience/ thoughts / help with the decision. I'm currently using mysql 5.13 and im pretty sure that even 5.5 on doesn't have the distance metric.
Also - even if 2. works, which one will be faster? Please let me know what your thoughts are and especially if you are sure / have seen something work for quick and large lookups!
Mysql Spatial Index: http://dev.mysql.com/doc/refman/5.5/en/using-a-spatial-index.html