public struct GeoPolygon : Hashable

Represents a GeoPolygon area as a series of geographic coordinates, and optionally, a list of inner boundaries (also known as holes). An instance of this class, initialized with appropriate vertices.

  • The list of geographic coordinates representing the outer boundary vertices of polygon.

    Declaration

    Swift

    public let vertices: [GeoCoordinates]
  • The list of polygon inner boundaries (holes), each defined as a list of geographic coordinates.

    Declaration

    Swift

    public let innerBoundaries: [[GeoCoordinates]]
  • Constructs an instance of this class from the provided vertices. Throws InstantiationError if the number of vertices is less than three.

    Throws

    InstantiationError Instantiation error.

    Declaration

    Swift

    public init(vertices: [GeoCoordinates]) throws

    Parameters

    vertices

    List of vertices representing the polygon outer boundary in clockwise order.

  • Constructs an instance of this class from the provided vertices and inner boundaries (holes). Throws InstantiationError if the number of vertices is less than three.

    Throws

    InstantiationError Instantiation error.

    Declaration

    Swift

    public init(vertices: [GeoCoordinates], innerBoundaries: [[GeoCoordinates]]) throws

    Parameters

    vertices

    List of vertices representing the polygon outer boundary in clockwise order.

    innerBoundaries

    List of polygon inner boundaries (holes), each in counterclockwise order.

  • Constructs an instance of this class from GeoCircle.

    Declaration

    Swift

    public init(geoCircle: GeoCircle)

    Parameters

    geoCircle

    A GeoCircle to be converted into GeoPolygon.

  • Constructs an instance of this class from GeoBox.

    Declaration

    Swift

    public init(geoBox: GeoBox)

    Parameters

    geoBox

    A GeoBox to be converted into GeoPolygon.