Ring
public struct Ring
extension Ring: Codable
Creates a Ring
struct that represents a closed figure that is bounded by three or more straight line segments.
-
Undocumented
Declaration
Swift
public var coordinates: [CLLocationCoordinate2D]
-
Undocumented
Declaration
Swift
public init(coordinates: [CLLocationCoordinate2D])
-
Calculate the approximate area of the polygon were it projected onto the earth, in square meters. Note that this area will be positive if ring is oriented clockwise, otherwise it will be negative.
Reference: Robert. G. Chamberlain and William H. Duquette, “Some Algorithms for Polygons on a Sphere”, JPL Publication 07-03, Jet Propulsion Laboratory, Pasadena, CA, June 2007 https://trs.jpl.nasa.gov/handle/2014/41271
Declaration
Swift
public var area: Double { get }
-
Declaration
Swift
public init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Determines if the given point falls within the ring. The optional parameter
ignoreBoundary
will result in the method returning true if the given point lies on the boundary line of the ring.Declaration
Swift
public func contains(_ coordinate: CLLocationCoordinate2D, ignoreBoundary: Bool = false) -> Bool