View Source Geometry.LineString (Geometry v0.4.0)

A line-string struct, representing a 2D line.

A none empty line-string requires at least two points.

Link to this section Summary

Functions

Creates an empty LineString.

Creates a LineString from the given Geometry.Points.

Link to this section Types

@type t() :: %Geometry.LineString{points: Geometry.coordinates()}

Link to this section Functions

@spec new() :: t()

Creates an empty LineString.

examples

Examples

iex> LineString.new()
%LineString{points: []}
@spec new([Geometry.Point.t()]) :: t()

Creates a LineString from the given Geometry.Points.

examples

Examples

iex> LineString.new([Point.new(1, 2), Point.new(3, 4)])
%LineString{points: [[1, 2], [3, 4]]}