GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSGeometryContainsLocation
extern BOOL GMSGeometryContainsLocation(CLLocationCoordinate2D point,
GMSPath *_Nonnull path, BOOL geodesic)
Returns whether point
lies inside of path. The path is always considered closed, regardless of
whether the last point equals the first or not.
Inside is defined as not containing the South Pole – the South Pole is always outside.
path
describes great circle segments if geodesic
is YES, and rhumb (loxodromic) segments
otherwise.
If point
is exactly equal to one of the vertices, the result is YES. A point that is not equal
to a vertex is on one side or the other of any path segment – it can never be “exactly on the
border”.
See GMSGeometryIsLocationOnPath()
for a border test with tolerance.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eDetermines if a given point (CLLocationCoordinate2D) lies within a specified path.\u003c/p\u003e\n"],["\u003cp\u003eThe path is treated as closed, and the South Pole is always considered outside.\u003c/p\u003e\n"],["\u003cp\u003ePaths can represent great circle segments (geodesic) or rhumb segments (non-geodesic).\u003c/p\u003e\n"],["\u003cp\u003ePoints exactly matching a vertex are considered inside; otherwise, points are either inside or outside, with no "on the border" condition.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003eGMSGeometryIsLocationOnPath()\u003c/code\u003e for border checks with tolerance.\u003c/p\u003e\n"]]],[],null,["# GoogleNavigation Framework Reference\n\nGMSGeometryContainsLocation\n===========================\n\n extern BOOL GMSGeometryContainsLocation(CLLocationCoordinate2D point,\n ../Classes/GMSPath.html *_Nonnull path, BOOL geodesic)\n\nReturns whether `point` lies inside of path. The path is always considered closed, regardless of\nwhether the last point equals the first or not.\n\nInside is defined as not containing the South Pole -- the South Pole is always outside.\n\n`path` describes great circle segments if `geodesic` is YES, and rhumb (loxodromic) segments\notherwise.\n\nIf `point` is exactly equal to one of the vertices, the result is YES. A point that is not equal\nto a vertex is on one side or the other of any path segment -- it can never be \"exactly on the\nborder\".\n\nSee `GMSGeometryIsLocationOnPath()` for a border test with tolerance."]]