Geometry.CircularString (Geometry v1.2.0)

View Source

A circular-string struct, representing a 2D curve.

A non-empty circular-string requires at least three coordinates. In a sequence of arcs the end point of the previous arc is the start point of the next arc, just like the segments of a LineString. This means that a CircularString must have an odd number of points greater than 1.

Summary

Functions

Creates an empty CircularString.

Creates a CircularString from the given Geometry.Points.

Types

t()

@type t() :: %Geometry.CircularString{arcs: Geometry.arcs(), srid: Geometry.srid()}

Functions

new()

@spec new() :: t()

Creates an empty CircularString.

Examples

iex> CircularString.new()
%CircularString{arcs: [], srid: 0}

new(arcs, srid \\ 0)

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

Creates a CircularString from the given Geometry.Points.

Examples

iex> CircularString.new(
...>   [Point.new(1, 2), Point.new(3, 4), Point.new(5, 6)])
%CircularString{arcs: [[1, 2], [3, 4], [5, 6]], srid: 0}