I have an array of objects with some properties.
Ex: Restaurants {name, latitude, longitude, address}
I want to compare each object based on a particular property and return a list of distinct objects.
For example:
Array = [R1, R2, R3, R4, R5]
Let say, Restaurants R4 and R5 are closer to each other and they have the same latitude and longitude.
I need to compare and filter the array
($0.latitude == $1.latitude and $0.longitude == $1.longitude) rounded to 3 decimal points
so that the final result will have the following items [R1, R2, R3, R4]