#include <MPGeometryQueryProtocol.h>
◆ containsCoordinate:
- (BOOL) containsCoordinate: |
|
(CLLocationCoordinate2D) | coordinate |
|
Check if the given coordinate is contained within the polygon.
- Parameters
-
coordinate | coordinate to check for containment. |
- Returns
- YES of the coordinate is inside the polygon boundary AND outside any holes in the polygon.
-
NO if the coordinate is outside the polygon, or inside any holes in the polygon.
◆ containsCoordinate:ignorePolygonHoles:
- (BOOL) containsCoordinate: |
|
(CLLocationCoordinate2D) | coordinate |
ignorePolygonHoles: |
|
(BOOL) | ignorePolygonHoles |
Check if the given coordinate is contained within the polygon.
- Parameters
-
coordinate | coordinate to check for containment. |
ignorePolygonHoles | Should holes in a polygon be ignored |
- Returns
- YES of the coordinate is inside the polygon boundary AND outside any holes in the polygon.
-
NO if the coordinate is outside the polygon, or inside any holes in the polygon.
◆ containsCoordinate:ignorePolygonHoles:containmentMetadata:
Check if the given coordinate is contained within the polygon, and optionally return the coordinate closest to the polygon. If the polygon contains the coordinate, 'coordinate' is returned as nearestPoint. If coordinate is not contained, the nearest point is calculated.
- Parameters
-
coordinate | coordinate to check for containment. |
containmentMetadata | If not nil, the nearest point and distance on the polygon boundary is returned. Note this may be the nearest point on a polygon-hole. |
ignorePolygonHoles | YES to ignore polygon holes. |
- Returns
- NO if the coordinate is outside the polygon, or inside any holes in the polygon.
◆ containsLineSegmentFromCoordinate:toCoordinate:
- (BOOL) containsLineSegmentFromCoordinate: |
|
(CLLocationCoordinate2D) | u |
toCoordinate: |
|
(CLLocationCoordinate2D) | v |
Check if the given linesegment is fully contained within the polygon.
- Parameters
-
u | start coordinate of linesegment to check for containment. |
v | end coordinate of linesegment to check for containment. |
- Returns
- YES of the linesegment is fully inside the polygon boundary AND outside any holes in the polygon.
-
NO if the linesegment is not fully inside the polygon, or inside any holes in the polygon.
◆ containsPoint:
- (BOOL) containsPoint: |
|
(nonnull MPPoint *) | point |
|
Check if the given point is contained within the polygon.
- Parameters
-
point | point to check for containment. |
- Returns
- YES of the point is inside the polygon boundary AND outside any holes in the polygon.
-
NO if the point is outside the polygon, or inside any holes in the polygon.
◆ area
The area of the polygon computed as the area of the outer path with the area of all holes subtracted.