How can I add a radius to a CLLocation coordinate? What I want is to see what clients are near a specific coordinate.
What I need is to add 2000 meters, or 2km to a coordinate.
How do I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t “add a radius” to a coordinate. What you can do if you have
CLLocationobjects (say loc1 and loc2), is calculate the distance between them:and see if dist (which is in meters) is more or less than 2000.0.
Converting between coordinate latitudes/longitudes (which are polar coordinates) and distances is complicated, which is why the SDK provides you with this functionality.