View Source Geometry.MultiPoint (Geometry v0.4.0)

A set of points from type Geometry.Point.

MultiPoint implements the protocols Enumerable and Collectable.

examples

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

Link to this section Summary

Functions

Creates an empty MultiPoint.

Creates a MultiPoint from the given Geometry.Points.

Link to this section Types

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

Link to this section Functions

@spec new() :: t()

Creates an empty MultiPoint.

examples

Examples

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

Creates a MultiPoint from the given Geometry.Points.

examples

Examples

iex> MultiPoint.new([
...>   Point.new(1, 2),
...>   Point.new(3, 4)
...> ])
%MultiPoint{points: [[1, 2], [3, 4]]}

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