Geometry.MultiLineStringZM (Geometry v1.1.0)

View Source

A set of line-strings from type Geometry.LineStringZM

MultiLineStringZM implements the protocols Enumerable and Collectable.

Examples

iex> Enum.map(
...>   MultiLineStringZM.new([
...>     LineStringZM.new([
...>       PointZM.new(1, 2, 3, 4),
...>       PointZM.new(3, 4, 5, 6)
...>     ]),
...>     LineStringZM.new([
...>       PointZM.new(1, 2, 3, 4),
...>       PointZM.new(11, 12, 13, 14),
...>       PointZM.new(13, 14, 15, 16)
...>     ])
...>   ]),
...>   fn line_string -> length line_string end
...> )
[2, 3]

iex> Enum.into(
...>   [LineStringZM.new([PointZM.new(1, 2, 3, 4), PointZM.new(5, 6, 7, 8)])],
...>   MultiLineStringZM.new())
%MultiLineStringZM{line_strings: [[[1, 2, 3, 4], [5, 6, 7, 8]]]}

Summary

Functions

Creates an empty MultiLineStringZM.

Creates a MultiLineStringZM from the given Geometry.MultiLineStringZMs.

Types

t()

@type t() :: %Geometry.MultiLineStringZM{
  line_strings: [Geometry.path()],
  srid: Geometry.srid()
}

Functions

new()

@spec new() :: t()

Creates an empty MultiLineStringZM.

Examples

iex> MultiLineStringZM.new()
%MultiLineStringZM{}

new(line_strings, srid \\ 0)

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

Creates a MultiLineStringZM from the given Geometry.MultiLineStringZMs.

Examples

iex> MultiLineStringZM.new([
...>   LineStringZM.new([
...>     PointZM.new(1, 2, 3, 4),
...>     PointZM.new(2, 3, 4, 5),
...>     PointZM.new(3, 4, 5, 6)
...>   ]),
...>   LineStringZM.new([
...>     PointZM.new(10, 20, 30, 40),
...>     PointZM.new(30, 40, 50, 60)
...>   ])
...> ])
%Geometry.MultiLineStringZM{
  line_strings: [
      [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6]],
      [[10, 20, 30, 40], [30, 40, 50, 60]]
    ],
  srid: 0
}

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