I have a scenario, I have users along with there address lat lng in my MySQL database, Now I need to get all the users who are within 2 km away from me (me as my lat lng ) I have one solution as I will get all the user's lat lng and apply #haversineformula and calculated distance and figure out all who are within 2km. Is there any good approach as I don't want to fetch all the users and filter out them. If there is something I can do within MySQL only using some sort of query. Appreciate any help
Asked
Active
Viewed 46 times
0
-
Possible duplicate of https://stackoverflow.com/questions/29553895/querying-mysql-for-latitude-and-longitude-coordinates-that-are-within-a-given-mi – dbl Sep 04 '18 at 15:04
-
Why tag [tag:java] then? – Patrick Parker Sep 04 '18 at 15:19