I have several thousand locations stored in CoreData and I would like to search for locations that are within a Google Maps visibleRegion. I was previously doing a search with a bounding box but the addition of the bearing feature breaks this type of query. I have several ideas but this must be a common problem with some well thought out solutions. I'd be interested to see if any solutions use geohashes.
This is my query that breaks when the bearing is not due north.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(lat > %f AND lat < %f AND lng > %f AND lng < %f)",
[self.googleMap.projection visibleRegion].nearLeft.latitude,
[self.googleMap.projection visibleRegion].farLeft.latitude,
[self.googleMap.projection visibleRegion].nearLeft.longitude,
[self.googleMap.projection visibleRegion].nearRight.longitude
];