0

I have data structured as :

properties : 
    unique-property-id :
        lat: 41.032, 
        lng: 28.9832
    another-unique-property-id:
        lat: another-lat,
        lng: another-lng

How can I search these properties as between max_lat and min_lat and between max_lng and min_lng ?

I am using firebase-php

Do I have to download all the data and do a search on php side?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Süha Boncukçu
  • 913
  • 1
  • 10
  • 29
  • Firebase can only order/filter a single property. Luckily there's a [library called Geofire](https://github.com/firebase/geofire/) that combines latitude and longitude into a single value (called a Geohash) and then can use those for filtering. The link above provides information about that library, which is available for JavaScript, Android and iOS. There is no PHP version of the library though, so you'll have to figure out how to deal with that hurdle yourself. – Frank van Puffelen Dec 12 '15 at 05:45
  • See http://stackoverflow.com/questions/21209469/handling-geocoding-in-firebase – Frank van Puffelen Dec 12 '15 at 05:51

0 Answers0