Geometry.Point (Geometry v1.1.0)
View SourceA point struct, representing a 2D point.
Summary
Functions
Creates an empty Point
.
Creates a Point
from the given coordinate
.
Creates a Point
from the given x
and y
, or a coordinate and an srid
Creates a Point
from the given x
and y
.
Types
@type t() :: %Geometry.Point{ coordinates: Geometry.coordinates() | [], srid: Geometry.srid() }
Functions
@spec new() :: t()
Creates an empty Point
.
Examples
iex> Point.new()
%Point{coordinates: []}
@spec new(Geometry.coordinates()) :: t()
Creates a Point
from the given coordinate
.
Examples
iex> Point.new([1.5, -2.1])
%Point{coordinates: [1.5, -2.1], srid: 0}
@spec new(Geometry.coordinates() | [], Geometry.srid()) :: t()
@spec new(number(), number()) :: t()
Creates a Point
from the given x
and y
, or a coordinate and an srid
Examples
iex> Point.new(-1.1, 2.2)
%Point{coordinates: [-1.1, 2.2], srid: 0}
@spec new(number(), number(), Geometry.srid()) :: t()
Creates a Point
from the given x
and y
.
Examples
iex> Point.new(-1.1, 2.2, 4326)
%Point{coordinates: [-1.1, 2.2], srid: 4326}