View Source Geometry.MultiPointM (Geometry v0.4.0)

A set of points from type Geometry.PointM.

MultiPointM implements the protocols Enumerable and Collectable.

examples

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]]}

Link to this section Summary

Functions

Creates an empty MultiPointM.

Creates a MultiPointM from the given Geometry.PointMs.

Link to this section Types

@type t() :: %Geometry.MultiPointM{points: [Geometry.coordinate()]}

Link to this section Functions

@spec new() :: t()

Creates an empty MultiPointM.

examples

Examples

iex> MultiPointM.new()
%MultiPointM{points: []}
@spec new([Geometry.PointM.t()]) :: t()

Creates a MultiPointM from the given Geometry.PointMs.

examples

Examples

iex> MultiPointM.new([
...>   PointM.new(1, 2, 4),
...>   PointM.new(3, 4, 6)
...> ])
%MultiPointM{points: [[1, 2, 4], [3, 4, 6]]}

iex> MultiPointM.new([])
%MultiPointM{points: []}