0

I wanna know if my point is in my bounding box using coordinates:

point to check:

CLLocation -> 48.847172 2.386597

bounding box :

maxLat minLat / maxLon minLon

"48.7998602295",
"48.8198640442",
"2.46138595581",
"2.48138619423"

how can i check that ?

james075
  • 1,280
  • 1
  • 12
  • 22
  • 1
    side note for checking if a radial area contains a CLLocation: https://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLRegion_class/Reference/Reference.html#//apple_ref/doc/uid/TP40009575-CH1-SW9 – Aram Kocharyan Jan 25 '13 at 11:53

1 Answers1

5

Would CGRectContainsPoint

bool CGRectContainsPoint (
  CGRect rect,
  CGPoint point
);

work for you?

You can convert a CLLocationCoordinate2D into a CGPoint like this:

CGPoint p = (CGPoint) { loc.latitude, loc.longitude };
sergio
  • 68,819
  • 11
  • 102
  • 123