Geometry.MultiSurface
(Geometry v1.2.0)
View Source
A multi-surface struct, representing a 2D collection of surfaces.
A MultiSurface is a collection of surfaces which can include Polygons or CurvePolygons.
Summary
Types
@type surface() :: Geometry.Polygon.t() | Geometry.CurvePolygon.t()
@type t() :: %Geometry.MultiSurface{srid: Geometry.srid(), surfaces: [surface()]}
Functions
@spec new() :: t()
Creates an empty MultiSurface.
Examples
iex> Geometry.MultiSurface.new()
%Geometry.MultiSurface{surfaces: [], srid: 0}
@spec new([surface()], Geometry.srid()) :: t()
Creates a MultiSurface from the given surfaces.
Examples
iex> Geometry.MultiSurface.new([
...> Geometry.Polygon.new([
...> Geometry.LineString.new([
...> Geometry.Point.new(0, 0), Geometry.Point.new(4, 0),
...> Geometry.Point.new(4, 4), Geometry.Point.new(0, 4),
...> Geometry.Point.new(0, 0)
...> ])
...> ])
...> ])
%Geometry.MultiSurface{
surfaces: [
%Geometry.Polygon{rings: [[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], srid: 0}
],
srid: 0
}