Geometry.MultiPoint (Geometry v1.1.0)

View Source

A 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

Functions

Creates an empty MultiPoint.

Creates a MultiPoint from the given Geometry.Points.

Types

t()

@type t() :: %Geometry.MultiPoint{
  points: [Geometry.coordinates()],
  srid: Geometry.srid()
}

Functions

new()

@spec new() :: t()

Creates an empty MultiPoint.

Examples

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

new(points, srid \\ 0)

@spec new([Geometry.Point.t()], Geometry.srid()) :: t()

Creates a MultiPoint from the given Geometry.Points.

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}