Ring
public struct Ring : Sendable
extension Ring: Codable
A linear ring is a closed figure bounded by three or more straight line segments.
-
The positions at which the linear ring is located.
Declaration
Swift
public var coordinates: [LocationCoordinate2D] -
Initializes a linear ring defined by the given positions.
Declaration
Swift
public init(coordinates: [LocationCoordinate2D])Parameters
coordinatesThe positions at which the linear ring is located.
-
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 } -
Determines if the given point falls within the ring. The optional parameter
ignoreBoundarywill result in the method returning true if the given point lies on the boundary line of the ring.Declaration
Swift
public func contains(_ coordinate: LocationCoordinate2D, ignoreBoundary: Bool = false) -> Bool -
Declaration
Swift
public init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to encoder: Encoder) throws
View on GitHub
Install in Dash
Ring Structure Reference