geolocation - fastest way to find geo points within a range in mysql -


i query possible streetnames within radius of 500 meters of given point. multiple posts reffering google store locator example using haversine formula or version of it. came across posts have much more simplified solution.

they treat points x,y coordinates adding lat , long variables seen below.

i wandering if fastest way query mysql without getting complicated , still result. don't have lot of data yet, want know if on right track. there disadvantages or inaccuracy's using method?

what don't how can radius range, looks more 1 directional query?

distance = 0.1; // range in degrees (0.1 degrees close 11km) latn = lat + distance; lats = lat - distance; lone = lon + distance; lonw = lon - distance;  ...query db following: select * table_name  (store_lat between latn , lats) , (store_lon between lone , lonw) 

ithink can use spatial indexes in mysql in case, read more this: http://dev.mysql.com/doc/refman/5.5/en/functions-for-testing-spatial-relations-between-geometric-objects.html


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -