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