Geometry.MultiLineStringM (Geometry v1.1.0)

View Source

A set of line-strings from type Geometry.LineStringM

MultiLineStringMZ implements the protocols Enumerable and Collectable.

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]]], srid: 0}

Summary

Functions

Creates an empty MultiLineStringM.

Creates a MultiLineStringM from the given Geometry.MultiLineStringMs.

Types

t()

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

Functions

new()

@spec new() :: t()

Creates an empty MultiLineStringM.

Examples

iex> MultiLineStringM.new()
%MultiLineStringM{}

new(line_strings, srid \\ 0)

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

Creates a MultiLineStringM from the given Geometry.MultiLineStringMs.

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]]
    ],
    srid: 0
}

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