Polygon
public struct Polygon : Equatable
Undocumented
-
Undocumented
Declaration
Swift
public var coordinates: [[CLLocationCoordinate2D]] -
Undocumented
Declaration
Swift
public init(_ coordinates: [[CLLocationCoordinate2D]]) -
Undocumented
-
Initializes a polygon as a given center coordinate with a given number of vertices, as a means to approximate a circle.
Declaration
Swift
public init(center: CLLocationCoordinate2D, radius: CLLocationDistance, vertices: Int)Parameters
centerThe center coordinate for the polygon.
radiusThe radius of the polygon, measured in meters.
verticesThe number of vertices the polygon will have. The recommended amount is 64.
Return Value
A polygon shape which approximates a circle.
-
Representation of
.Polygons coordinates of inner ringsDeclaration
Swift
public var innerRings: [Ring] { get } -
Representation of
.Polygons coordinates of outer ringDeclaration
Swift
public var outerRing: Ring { get } -
An area of current
.PolygonPorted from https://github.com/Turfjs/turf/blob/a94151418cb969868fdb42955a19a133512da0fd/packages/turf-area/index.js
Declaration
Swift
public var area: Double { get } -
Determines if the given coordinate falls within the polygon and outside of its interior rings. The optional parameter
ignoreBoundarywill result in the method returning true if the given coordinate lies on the boundary line of the polygon or its interior rings.Declaration
Swift
public func contains(_ coordinate: CLLocationCoordinate2D, ignoreBoundary: Bool = false) -> Bool
View on GitHub
Install in Dash
Polygon Structure Reference