Geometry.MultiLineString (Geometry v1.1.0)
View SourceA set of line-strings from type Geometry.LineString
MultiLineStringMZ
implements the protocols Enumerable
and Collectable
.
Examples
iex> Enum.map(
...> MultiLineString.new([
...> LineString.new([
...> Point.new(1, 2),
...> Point.new(3, 4)
...> ]),
...> LineString.new([
...> Point.new(1, 2),
...> Point.new(11, 12),
...> Point.new(13, 14)
...> ])
...> ]),
...> fn line_string -> length line_string end
...> )
[2, 3]
iex> Enum.into(
...> [LineString.new([Point.new(1, 2), Point.new(5, 6)])],
...> MultiLineString.new())
%MultiLineString{
line_strings: [[[1, 2], [5, 6]]], srid: 0
}
Summary
Functions
Creates an empty MultiLineString
.
Creates a MultiLineString
from the given Geometry.MultiLineString
s.
Types
@type t() :: %Geometry.MultiLineString{ line_strings: [Geometry.path()], srid: Geometry.srid() }
Functions
@spec new() :: t()
Creates an empty MultiLineString
.
Examples
iex> MultiLineString.new()
%MultiLineString{}
@spec new([Geometry.LineString.t()], Geometry.srid()) :: t()
Creates a MultiLineString
from the given Geometry.MultiLineString
s.
Examples
iex> MultiLineString.new([
...> LineString.new([
...> Point.new(1, 2),
...> Point.new(2, 3),
...> Point.new(3, 4)
...> ]),
...> LineString.new([
...> Point.new(10, 20),
...> Point.new(30, 40)
...> ])
...> ])
%Geometry.MultiLineString{
line_strings: [
[[1, 2], [2, 3], [3, 4]],
[[10, 20], [30, 40]]
],
srid: 0
}
iex> MultiLineString.new([])
%MultiLineString{line_strings: [], srid: 0}