I have the following Firebase Database structure,
"-KSupX7CppMD1zbqIy0y" : {
"addedByUser" : "zQpb7o18VzYsSoTQtT9DNhOqTUn2",
"content" : "Post 1",
"cost" : "20",
"duration" : "Weekly",
"latitude" : "40.7594479995956",
"longitude" : "-73.9838934062393",
"timestamp" : "Fri 30 Sep"
},
"-KSuphuqO6a0lnrJYUkt" : {
"addedByUser" : "zQpb7o18VzYsSoTQtT9DNhOqTUn2",
"content" : "Post 2",
"cost" : "10",
"duration" : "Daily",
"latitude" : "40.7594329996462",
"longitude" : "-73.9846261181847",
"timestamp" : "Fri 30 Sep"
}
I need to filter the posts within certain distance parameters (less than 50m, 100m, 150m & 200m) I can get the coordinate from the "longitude" & "latitude" but I'm struggling to filter the posts. Any help would be greatly appreciated.
Many thanks in advance. Newbie to Firebase & Swift.