I have GeoPoints stored as location in firestore within users collection.
Using my current GeoPoint, I need to get documents/users around me based on a given distance. As an example I need to get users around me within 100km.
I searched on stackoverflow and realized there are only few GeoPoint based firestore questions. According to those I constructed a query similar to below,
function getUsers(lower, upper) {
let db = admin.firestore();
var usersRef = db.collection('users')
.where('location', isGreaterThan, lower)
.where('location', isLessThan, upper);
var users = usersRef.get();
return users;
}
But my question is,
How can I construct "lower" and "upper" GeoPoints based on a given distance?
Im bit confused here as GeoPoints consist of Longitude and Latitude which represent a point in the map. Having two points (lower, upper) in the map, is it possible to get a bounding circle with a radius of 100km?
Also please give your suggestions if you have better solutions to achieve this using GeoPoint in firestore. Can't we pass my current GeoPoint and a radius value which ultimately gives documents around that circle?