2

I want to pull all my freinds checkin at a given location or in a radius of 5000m. I am able to pull this data using the checkin Id but not sure how to do it for a location or in radius of 5000m- I have tried the below query, can someone please help

SELECT author_uid FROM checkin WHERE checkin_id ='823627496738' AND author_uid IN (SELECT uid2 FROM       friend WHERE uid1 = me()) OR tagged_uids IN (SELECT uid2 FROM friend WHERE uid1 = me())

1 Answer 1

0

You can use coords column in checkin table.

SELECT coords,author_uid,author FROM checkin WHERE coords.latitude < '15.479513888889' AND coords.latitude < '20.479513888889' AND coords.longitude > '70.891111111111' AND coords.longitude < '80.891111111111' AND author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) OR tagged_uids IN (SELECT uid2 FROM friend WHERE uid1 = me())

you can use something like the above. Here you have to set the latitude and longitude range.. I do not know how to calculate the latitude and longitude within certain radius... But this might help you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.