View Source Geometry.GeometryCollectionZ (Geometry v0.4.0)
A collection set of 3D geometries.
GeometryCollectionZ implements the protocols Enumerable and Collectable.
examples
Examples
iex> Enum.map(
...> GeometryCollectionZ.new([
...> PointZ.new(11, 12, 13),
...> LineStringZ.new([
...> PointZ.new(21, 22, 23),
...> PointZ.new(31, 32, 33)
...> ])
...> ]),
...> fn
...> %PointZ{} -> :point
...> %LineStringZ{} -> :line_string
...> end
...> ) |> Enum.sort()
[:line_string, :point]
iex> Enum.into([PointZ.new(1, 2, 3)], GeometryCollectionZ.new())
%GeometryCollectionZ{geometries: [%PointZ{coordinate: [1, 2, 3]}]}
Link to this section Summary
Link to this section Types
@type t() :: %Geometry.GeometryCollectionZ{geometries: [Geometry.t()]}
Link to this section Functions
@spec new() :: t()
Creates an empty GeometryCollectionZ.
examples
Examples
iex> GeometryCollectionZ.new()
%GeometryCollectionZ{geometries: []}
@spec new([Geometry.t()]) :: t()
Creates an empty GeometryCollectionZ.
examples
Examples
iex> GeometryCollectionZ.new([
...> PointZ.new(1, 2, 3),
...> LineStringZ.new([PointZ.new(1, 1, 1), PointZ.new(2, 2, 2)])
...> ])
%GeometryCollectionZ{geometries: [
%PointZ{coordinate: [1, 2, 3]},
%LineStringZ{points: [[1, 1, 1], [2, 2, 2]]}
]}