Geometry.MultiPointM (Geometry v1.1.0)

View Source

A 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

Functions

Creates an empty MultiPointM.

Creates a MultiPointM from the given Geometry.PointMs.

Types

t()

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

Functions

new()

@spec new() :: t()

Creates an empty MultiPointM.

Examples

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

new(points, srid \\ 0)

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

Creates a MultiPointM from the given Geometry.PointMs.

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}