View Source Geometry.MultiLineStringM (Geometry v0.4.0)

A set of line-strings from type Geometry.LineStringM

MultiLineStringMZ implements the protocols Enumerable and Collectable.

examples

Examples

iex> Enum.map(
...>   MultiLineStringM.new([
...>     LineStringM.new([
...>       PointM.new(1, 2, 4),
...>       PointM.new(3, 4, 6)
...>     ]),
...>     LineStringM.new([
...>       PointM.new(1, 2, 4),
...>       PointM.new(11, 12, 14),
...>       PointM.new(13, 14, 16)
...>     ])
...>   ]),
...>   fn line_string -> length line_string end
...> )
[2, 3]

iex> Enum.into(
...>   [LineStringM.new([PointM.new(1, 2, 4), PointM.new(5, 6, 8)])],
...>   MultiLineStringM.new())
%MultiLineStringM{line_strings: [[[1, 2, 4], [5, 6, 8]]]}

Link to this section Summary

Functions

Creates an empty MultiLineStringM.

Creates a MultiLineStringM from the given Geometry.MultiLineStringMs.

Link to this section Types

@type t() :: %Geometry.MultiLineStringM{line_strings: [Geometry.coordinates()]}

Link to this section Functions

@spec new() :: t()

Creates an empty MultiLineStringM.

examples

Examples

iex> MultiLineStringM.new()
%MultiLineStringM{}
@spec new([Geometry.LineStringM.t()]) :: t()

Creates a MultiLineStringM from the given Geometry.MultiLineStringMs.

examples

Examples

iex> MultiLineStringM.new([
...>   LineStringM.new([
...>     PointM.new(1, 2, 4),
...>     PointM.new(2, 3, 5),
...>     PointM.new(3, 4, 6)
...>   ]),
...>   LineStringM.new([
...>     PointM.new(10, 20, 40),
...>     PointM.new(30, 40, 60)
...>   ])
...> ])
%Geometry.MultiLineStringM{
  line_strings:
    [
      [[1, 2, 4], [2, 3, 5], [3, 4, 6]],
      [[10, 20, 40], [30, 40, 60]]
    ]
}

iex> MultiLineStringM.new([])
%MultiLineStringM{}