Can any trig or GPS experts help me out here? I\'m trying to create a geo-spacial bounding box (rectangle) calculation returning the maximum latitude and longitude using the
How are you guys setting up the NSPredicates?
I seem to run into performance issues with mine.
NSPredicate *northWestLat = [NSPredicate predicateWithFormat:@"ANY locations.lat > %lf", northWestCorner.latitude];
NSPredicate *southhWestLat = [NSPredicate predicateWithFormat:@"ANY locations.lat < %lf", southEastCorner.latitude];
NSPredicate *latitudePredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:northWestLat, southhWestLat, nil]];
NSPredicate *northWestLng = [NSPredicate predicateWithFormat:@"ANY locations.lng < %lf", northWestCorner.longitude];
NSPredicate *southEastLng = [NSPredicate predicateWithFormat:@"ANY locations.lng > %lf", southEastCorner.longitude];
NSPredicate *longitudePredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:northWestLng, southEastLng, nil]];
NSPredicate *coordPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:latitudePredicate, longitudePredicate, nil]];