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