Find user within a radius

I am developing an application that will look for other users that is within my radius. A radius of 200 meters for example.

Do you have any idea how I could do that?

There are distance calculation extensions that return the great-circle distance.

thanks but unfortunately it won’t work for me
why the n app will get the coordinates of other users
they stayed in the database and did not
and the most that can happen is to make a comparison

the idea was to make a circle with the following information
the user coordinates and the radius of the circle that would be 200 meters

Then the programming would be done like this: after it was done this circle would make the comparison to find out if any item of fire base is within the circle

Anyway the doubt is how I can make a circle being that the information that will have is the location of the user and the radius that would be 200 meters

You can’t “draw” the circle to scale, as far as I know, but I could be wrong. You do need the coordinates of all users to be making comparisons.

OK. It doesn’t have to be a circle, I just wanted to simulate an area of 200 meters I tried to do this by messing with the accuracy of the coordinates I got close but still had margin of error because I was taking a user who was out of that radius

could be any figure, anything that presents a limited area stirring in the decimal places of the coordinates

You wouldn’t face that problem using the extension I linked,

I took a look there in the extension, very good but in my case I believe it would not be possible for me to use it in this programming

1 Like

users will stay in FireBase the coordinates will be the tags

I put in the schedule to get the list of tags ie get the coordinates of all users.

After you get all these users will compare which one is closest

I believe the easiest way to know which one is closest is by doing this. But I’m open to suggestions

I liked the idea how could I add your extension in this schedule?

Oh it’s not my extension. Anyway, you could run the procedure in the extension to get the distance between two points in kilometres. So you could compare user distances and show them if the result was 0.2 or less.

1 Like