0

Im working on a locationbased App in Ionic and I am using Firebase as my database. In my App I want to be able to save the location of the user with longitude and latitude.

Everything is working fine so far, but now I want to be able to return specific entries based on the last digits of the coordinates so I get a circle around the location of my user. For example: I'm at the latitude 50.5000000 and the longitude 50.0000000. Now I want to return every entry of my database with the langitude and latitude somwhere between 50.2500000 and 50.7500000 since thats going to be, according to my understanding of longitude and latitude, roughly 50km around my location.

Is there a way to implement such a request or do I have to return every entry and calculate this inside of my App?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Brecherchef
  • 401
  • 6
  • 22
  • 2
    If you're using the Firebase Realtime Database, you're looking for [Geofire](https://stackoverflow.com/questions/40272146/firebase-location-query/40272342#40272342). If you're using Cloud Firestore, you're looking for one of the 3rd party [GeoFirestore](https://stackoverflow.com/questions/46630507/how-to-run-a-geo-nearby-query-with-firestore) libraries. – Frank van Puffelen May 20 '19 at 16:10
  • Thank you very much! :) – Brecherchef May 20 '19 at 17:32

0 Answers0