Documentation
¶
Overview ¶
Package pgeo implements geometric types for Postgres
Geometryc types: https://www.postgresql.org/docs/current/static/datatype-geometric.html
Description: https://github.com/saulortega/pgeo
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box [2]Point
Box is represented by pair of points that are opposite corners of the box.
func NewRandBox ¶
func NewRandBox() Box
type Circle ¶
Circles are represented by a center point and radius.
func NewRandCircle ¶
func NewRandCircle() Circle
type Line ¶
Line represents a infinite line with the linear equation Ax + By + C = 0, where A and B are not both zero.
func NewRandLine ¶
func NewRandLine() Line
type Lseg ¶
type Lseg [2]Point
Line segments are represented by pairs of points that are the endpoints of the segment.
func NewRandLseg ¶
func NewRandLseg() Lseg
type NullCircle ¶
func NewNullCircle ¶
func NewNullCircle(C Circle, v bool) NullCircle
func (*NullCircle) MarshalJSON ¶
func (c *NullCircle) MarshalJSON() ([]byte, error)
func (*NullCircle) Scan ¶
func (c *NullCircle) Scan(src interface{}) error
func (*NullCircle) UnmarshalJSON ¶
func (c *NullCircle) UnmarshalJSON(data []byte) error
type NullPoint ¶
func NewNullPoint ¶
func (*NullPoint) MarshalJSON ¶
func (*NullPoint) UnmarshalJSON ¶
type NullPolygon ¶
func NewNullPolygon ¶
func NewNullPolygon(P Polygon, v bool) NullPolygon
func (*NullPolygon) MarshalJSON ¶
func (p *NullPolygon) MarshalJSON() ([]byte, error)
func (*NullPolygon) Scan ¶
func (p *NullPolygon) Scan(src interface{}) error
func (*NullPolygon) UnmarshalJSON ¶
func (p *NullPolygon) UnmarshalJSON(data []byte) error
type Path ¶
Path is represented by list of connected points. Paths can be open, where the first and last points in the list are considered not connected, or closed, where the first and last points are considered connected.
func NewRandPath ¶
func NewRandPath() Path
func (*Path) MarshalJSON ¶
func (*Path) UnmarshalJSON ¶
type Point ¶
Points are the fundamental two-dimensional building block for geometric types. X and Y are the respective coordinates, as floating-point numbers
func NewRandPoint ¶
func NewRandPoint() Point
func NewZeroPoint ¶
func NewZeroPoint() Point
func RandPoints ¶
type Polygon ¶
type Polygon []Point
Polygons are represented by lists of points (the vertexes of the polygon).
func NewPolygon ¶
func NewRandPolygon ¶
func NewRandPolygon() Polygon