# MultiPolygon

``public struct MultiPolygon : Equatable, ForeignMemberContainer``
``extension MultiPolygon: Codable``
``extension MultiPolygon: GeometryConvertible``

A MultiPolygon geometry is a collection of `Polygon` geometries that are disconnected but related.

• ``` coordinates ```

The positions at which the multipolygon is located. Each nested array corresponds to one polygon.

#### Declaration

Swift

``public var coordinates: [[[LocationCoordinate2D]]]``
• ``` foreignMembers ```

#### Declaration

Swift

``public var foreignMembers: JSONObject``
• ``` polygons ```

The polygon geometries that conceptually form the multipolygon.

#### Declaration

Swift

``public var polygons: [Polygon] { get }``
• ``` init(_:) ```

Initializes a multipolygon defined by the given positions.

#### Declaration

Swift

``public init(_ coordinates: [[[LocationCoordinate2D]]])``

#### Parameters

 ``` coordinates ``` The positions at which the multipolygon is located. Each nested array corresponds to one polygon.
• ``` init(_:) ```

Initializes a multipolygon coincident to the given polygons.

#### Declaration

Swift

``public init(_ polygons: [Polygon])``

#### Parameters

 ``` polygons ``` The polygons that together are coincident to the multipolygon.
• ``` init(from:) ```

#### Declaration

Swift

``public init(from decoder: Decoder) throws``
• ``` encode(to:) ```

#### Declaration

Swift

``public func encode(to encoder: Encoder) throws``
• ``` contains(_:ignoreBoundary:) ```

Determines if the given coordinate falls within any of the polygons. The optional parameter `ignoreBoundary` will result in the method returning true if the given coordinate lies on the boundary line of the polygon or its interior rings.

Calls contains function for each contained polygon

#### Declaration

Swift

``public func contains(_ coordinate: LocationCoordinate2D, ignoreBoundary: Bool = false) -> Bool``
• ``` geometry ```

#### Declaration

Swift

``public var geometry: Geometry { get }``