-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Currently in this Issue : #197 , the api will call all the photos what we want is the bring only photos that Lies within a specific radius.
For example if you are in Auditorium them Your location coordinates should go to backend and using that a radius of 300m or appropriate would be called so that photos which have loc cordinates within that zone will be called only.
This task require you to test things out and implement the backend logic as only Current Location coordinates will go from frontend.
Main implementation lies in the backend part.
Basic approach could be to seach images but that would be inefficeint.
Geoindexing for Images is in the schema for fast and effcient search.
PhotoSchema.index({ location: '2dsphere' });
you will need to implement this or something similiar
Photo.find({
location: {
$near: {
$geometry: {
type: "Point",
coordinates: [77.5946, 12.9716] // lng, lat
},
$maxDistance: 300
}
}
});
Test things out , upload some of ur own images.