Page 1 of 1

How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 4:03 pm
by Oren Pollack

I would like to display the distance between the user and other users.

Using tinder as an example, how do you calculate the distance between the two users.

Thank you!


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 4:28 pm
by maxkatz

Does Tinder provide REST API to do that?


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 5:07 pm
by Oren Pollack

Tinder was probably a poor example. Please ignore...

If a user logs in to an app from their phone, how could you find all the users around them that are within X miles? Currently have the users logging in through Facebook API if that changes anything.

Thank you.


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 5:27 pm
by Kateryna Grynko

Hi Oren,

You want to keep a record of all users: of their current position, for example in 35 minutes (all older - ignore or throw away), and to calculate all distances from one user to the other - there are resource-intensive calculations that can't be shifted to the user phone. Besides - it's specific disclosure of personal data, which is not good.

Of course, you can try to cache the computed distance and add math to triangulate other users ... but it's hard overhead.


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 5:42 pm
by Oren Pollack

Thank you Katya.

Do you think it would be more practical to have users "check-in" to a location and calculates the distances based off those "checked-in" locations?


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 5:52 pm
by Kateryna Grynko

Oren,

Yes, but you'll face the problems described above.
These references may be helpful:
http://docs.appery.io/tutorials/build...
http://www.movable-type.co.uk/scripts...


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 5:57 pm
by Kateryna Grynko

You need an independent backend, which should make all the calculations.

Otherwise it can only work as follows:
The user selects a list of the persons he wants to know the distance to and the application calculates. Otherwise, it can discharge phone battery make the time delay of the application.
The device can process within a reasonable time only 5-10 points for calculation.
I.e. a request like: Are these 10 people next to me?


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 6:04 pm
by Oren Pollack

Katya - So if the calculation said find users within 1 mile versus find users within 100 miles would it be quicker and less of a drain on the phone battery due to not as many calculations?


How could you calculate the distance between two users of an application?

Posted: Fri May 24, 2013 6:06 pm
by Kateryna Grynko

Yes.