Geometry.GeometryCollectionZM (Geometry v1.1.0)

View Source

A collection set of 3D geometries with a measurement.

GeometryCollectionZM implements the protocols Enumerable and Collectable.

Examples

iex> Enum.map(
...>   GeometryCollectionZM.new([
...>     PointZM.new(11, 12, 13, 14),
...>     LineStringZM.new([
...>       PointZM.new(21, 22, 23, 24),
...>       PointZM.new(31, 32, 33, 34)
...>     ])
...>   ]),
...>   fn
...>     %PointZM{} -> :point
...>     %LineStringZM{} -> :line_string
...>   end
...> ) |> Enum.sort()
[:line_string, :point]

iex> Enum.into([PointZM.new(1, 2, 3, 4)], GeometryCollectionZM.new())
%GeometryCollectionZM{geometries: [%PointZM{coordinates: [1, 2, 3, 4]}], srid: 0}

Summary

Functions

Creates an empty GeometryCollectionZM.

Creates an empty GeometryCollectionZM.

Types

t()

@type t() :: %Geometry.GeometryCollectionZM{
  geometries: [Geometry.t()],
  srid: Geometry.srid()
}

Functions

new()

@spec new() :: t()

Creates an empty GeometryCollectionZM.

Examples

iex> GeometryCollectionZM.new()
%GeometryCollectionZM{}

new(geometries, srid \\ 0)

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

Creates an empty GeometryCollectionZM.

Examples

iex> GeometryCollectionZM.new([
...>   PointZM.new(1, 2, 3, 4),
...>   LineStringZM.new([PointZM.new(1, 1, 1, 1), PointZM.new(2, 2, 2, 2)])
...> ])
%GeometryCollectionZM{geometries: [
  %PointZM{coordinates: [1, 2, 3, 4]},
  %LineStringZM{path: [[1, 1, 1, 1], [2, 2, 2, 2]]}
],
srid: 0}