Geometry.MultiPoint (Geometry v1.1.0)
View SourceA set of points from type Geometry.Point
.
MultiPoint
implements the protocols Enumerable
and Collectable
.
Examples
iex> Enum.map(
...> MultiPoint.new([
...> Point.new(1, 2),
...> Point.new(3, 4)
...> ]),
...> fn [x, _y] -> x end
...> )
[1, 3]
iex> Enum.into([Point.new(1, 2)], MultiPoint.new())
%MultiPoint{points: [[1, 2]]}
Summary
Types
@type t() :: %Geometry.MultiPoint{ points: [Geometry.coordinates()], srid: Geometry.srid() }
Functions
@spec new() :: t()
Creates an empty MultiPoint
.
Examples
iex> MultiPoint.new()
%MultiPoint{points: [], srid: 0}
@spec new([Geometry.Point.t()], Geometry.srid()) :: t()
Creates a MultiPoint
from the given Geometry.Point
s.
Examples
iex> MultiPoint.new([
...> Point.new(1, 2),
...> Point.new(3, 4)
...> ])
%MultiPoint{points: [[1, 2], [3, 4]], srid: 0}
iex> MultiPoint.new([])
%MultiPoint{points: [], srid: 0}