Open raginggoat opened 5 years ago
I am facing somewhat the same problem, where .documentEntered is called much more often than it should, and .documentExited is never called.
Did you find a solution?
I have observed that the calculation of distance doesn't appear to be correct. I have two points A and B which are located 1.08km apart (based on distance calculation from https://www.movable-type.co.uk/scripts/latlong.html); I have also double verified the CLLocation.distance() function also returns the same value of 1.08km as above between A and B. Based on this I am concluding that the distance between the points A and B are 1.08km.
The setLocation function will return a document at Position A.
I then create the following query: let query = geoFirestore.query(withCenter: positionB, radius: 1.0)
In the above scenario, since the distance between A and B is 1.08km (>1.0km), the documentEntered function should NOT enter. PROBLEM: The documentEntered function is entered. I then changed the radius = 0.5km however the documentEntered function enters again. I kept trying different values and noticed that when radius = 0.4863km, the documentEntered function DOES NOT enter, however radius = 0.4864km the documentEntered function is entered.
Can you please let me know why is this happening? How are you calculating the distance between two lat/long pairs?
I have observed that the calculation of distance doesn't appear to be correct. I have two points A and B which are located 1.08km apart (based on distance calculation from https://www.movable-type.co.uk/scripts/latlong.html); I have also double verified the CLLocation.distance() function also returns the same value of 1.08km as above between A and B. Based on this I am concluding that the distance between the points A and B are 1.08km.
The setLocation function will return a document at Position A.
I then create the following query: let query = geoFirestore.query(withCenter: positionB, radius: 1.0)
In the above scenario, since the distance between A and B is 1.08km (>1.0km), the documentEntered function should NOT enter. PROBLEM: The documentEntered function is entered. I then changed the radius = 0.5km however the documentEntered function enters again. I kept trying different values and noticed that when radius = 0.4863km, the documentEntered function DOES NOT enter, however radius = 0.4864km the documentEntered function is entered.
Can you please let me know why is this happening? How are you calculating the distance between two lat/long pairs?
Any solution?
I ended up not using GeoFirestore-iOS due to this issue.
I am using GeoFirestore to run geo queries against my Firebase Firestore. It seems to generally work but is returning more results than it should once I test with a radius of more than 25 miles. The closest location in my Firestore is 103 miles from the location I'm testing with. I've tested in 25 mile increments. 25 miles doesn't return any locations, 50 miles returns the closest one, 75 returns the closest one, and 100 miles returns all three of my test locations. Any idea what I'm doing wrong?