geom

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2018 License: MIT, MIT Imports: 1 Imported by: 0

README

geom

Geometry interfaces to help drive interoperability within the Go geospatial community. This package focuses on 2D geometries.

Documentation

Overview

Package geom describes geometry interfaces.

Index

Constants

This section is empty.

Variables

View Source
var ErrNilCollection = errors.New("geom: nil collection")
View Source
var ErrNilLineString = errors.New("geom: nil LineString")
View Source
var ErrNilMultiLineString = errors.New("geom: nil MultiLineString")
View Source
var ErrNilMultiPoint = errors.New("geom: nil MultiPoint")
View Source
var ErrNilMultiPolygon = errors.New("geom: nil MultiPolygon")
View Source
var ErrNilPoint = errors.New("geom: nil Point")
View Source
var ErrNilPolygon = errors.New("geom: nil Polygon")
View Source
var ErrUnknownGeometry = errors.New("unknown geometry")

ErrUnknownGeometry is returned when the geometry type is unknown or unsupported.

Functions

This section is empty.

Types

type BoundingBox

type BoundingBox [2][2]float64

BoundingBox represents X1, Y1, X2, Y2 (LL, UR) of a geometry

func NewBBox

func NewBBox(points ...[2]float64) (bbox BoundingBox)

NewBBox returns X1, Y1, X2, Y2 (LL, UR) for the input points

func (*BoundingBox) Add

func (bb *BoundingBox) Add(bbox BoundingBox)
========================= EXPANDING BOUNDING BOX =========================

Add will expand the boundong box to contain the given bounding box.

func (*BoundingBox) AddPoints

func (bb *BoundingBox) AddPoints(points ...[2]float64)

AddPoints will expand the bounding box to contain the given points.

func (BoundingBox) BottomLeft

func (bb BoundingBox) BottomLeft() [2]float64

BottomLeft point of the bounding box.

func (BoundingBox) BottomRight

func (bb BoundingBox) BottomRight() [2]float64

BottomRight point of the bounding box.

func (*BoundingBox) Contains

func (bb *BoundingBox) Contains(pt [2]float64) (v bool)

Contains will return weather the given point is inside of the bounding box.

func (BoundingBox) Edges

func (bb BoundingBox) Edges() [][2][2]float64

Edges returns the clockwise order of the edges that make up the extent.

func (BoundingBox) LREdges

func (bb BoundingBox) LREdges() [][2][2]float64

LREdges are the edges starting witht he left most edge to the lower right edge.

func (BoundingBox) MaxX

func (bb BoundingBox) MaxX() float64

MaxX is the larger of the x values.

func (BoundingBox) MaxY

func (bb BoundingBox) MaxY() float64

MaxY is the larger of the y values.

func (BoundingBox) MinX

func (bb BoundingBox) MinX() float64

MinX is the smaller of the x values.

func (BoundingBox) MinY

func (bb BoundingBox) MinY() float64

MinY is the smaller of the y values.

func (BoundingBox) TopLeft

func (bb BoundingBox) TopLeft() [2]float64

TopLeft point of the bounding box.

func (BoundingBox) TopRight

func (bb BoundingBox) TopRight() [2]float64

TopRight point of the bounding box.

func (BoundingBox) Verticies

func (bb BoundingBox) Verticies() [][2]float64

Verticies return the verticies of the Bounding Box.

type BoundingBoxer

type BoundingBoxer interface {
	BBox() (bbox [2][2]float64)
}

BoundingBoxer represents an interface that returns a boundbox.

type Collection

type Collection []Geometry

Collection is a collection of one or more geometries.

func (Collection) Geometries

func (c Collection) Geometries() []Geometry

Geometries returns the slice of Geometries

func (*Collection) SetGeometries

func (c *Collection) SetGeometries(input []Geometry) (err error)

SetGeometries modifies the array of 2D coordinates

type CollectionSetter

type CollectionSetter interface {
	Collectioner
	SetGeometries([]Geometry) error
}

CollectionSetter is a mutable Collectioner.

type Collectioner

type Collectioner interface {
	Geometry
	Geometries() []Geometry
}

Collectioner is a collections of different geometries.

type Geometry

type Geometry interface{}

Geometry is an object with a spatial reference. if a method accepts a Geometry type it's only expected to support the geom types in this package

type Line

type Line [2][2]float64

Line has exactly two points

type LineString

type LineString [][2]float64

LineString is a basic line type which is made up of two or more points that don't interect.

func (*LineString) SetVerticies

func (ls *LineString) SetVerticies(input [][2]float64) (err error)

SetVertexes modifies the array of 2D coordinates

func (LineString) Verticies

func (ls LineString) Verticies() [][2]float64

Vertexes returns a slice of XY values

type LineStringSetter

type LineStringSetter interface {
	LineStringer
	SetVerticies([][2]float64) error
}

LineStringSetter is a mutable LineStringer.

type LineStringer

type LineStringer interface {
	Geometry
	Verticies() [][2]float64
}

LineStringer is a line of two or more points.

type MultiLineString

type MultiLineString [][][2]float64

MultiLineString is a geometry with multiple LineStrings.

func (MultiLineString) LineStrings

func (mls MultiLineString) LineStrings() [][][2]float64

LineStrings returns the coordinates for the linestrings

func (*MultiLineString) SetLineStrings

func (mls *MultiLineString) SetLineStrings(input [][][2]float64) (err error)

SetLineStrings modifies the array of 2D coordinates

type MultiLineStringSetter

type MultiLineStringSetter interface {
	MultiLineStringer
	SetLineStrings([][][2]float64) error
}

MultiLineStringSetter is a mutable MultiLineStringer.

type MultiLineStringer

type MultiLineStringer interface {
	Geometry
	LineStrings() [][][2]float64
}

MultiLineStringer is a geometry with multiple LineStrings.

type MultiPoint

type MultiPoint [][2]float64

MultiPoint is a geometry with multiple points.

func (MultiPoint) Points

func (mp MultiPoint) Points() [][2]float64

Points returns the coordinates for the points

func (*MultiPoint) SetPoints

func (mp *MultiPoint) SetPoints(input [][2]float64) (err error)

SetPoints modifies the array of 2D coordinates

type MultiPointSetter

type MultiPointSetter interface {
	MultiPointer
	SetPoints([][2]float64) error
}

MultiPointSetter is a mutable MultiPointer.

type MultiPointer

type MultiPointer interface {
	Geometry
	Points() [][2]float64
}

MultiPointer is a geometry with multiple points.

type MultiPolygon

type MultiPolygon [][][][2]float64

MultiPolygon is a geometry of multiple polygons.

func (MultiPolygon) Polygons

func (mp MultiPolygon) Polygons() [][][][2]float64

Polygons returns the array of polygons.

func (*MultiPolygon) SetPolygons

func (mp *MultiPolygon) SetPolygons(input [][][][2]float64) (err error)

SetPolygons modifies the array of 2D coordinates

type MultiPolygonSetter

type MultiPolygonSetter interface {
	MultiPolygoner
	SetPolygons([][][][2]float64) error
}

MultiPolygonSetter is a mutable MultiPolygoner.

type MultiPolygoner

type MultiPolygoner interface {
	Geometry
	Polygons() [][][][2]float64
}

MultiPolygoner is a geometry of multiple polygons.

type Point

type Point [2]float64

Point describes a simple 2D point

func (*Point) SetXY

func (p *Point) SetXY(xy [2]float64) (err error)

SetXY sets a pair of coordinates

func (Point) XY

func (p Point) XY() [2]float64

XY returns an array of 2D coordinates

type PointSetter

type PointSetter interface {
	Pointer
	SetXY([2]float64) error
}

PointSetter is a mutable Pointer.

type Pointer

type Pointer interface {
	Geometry
	XY() [2]float64
}

Pointer is a point with two dimensions.

type Polygon

type Polygon [][][2]float64

Polygon is a geometry consisting of multiple closed LineStrings. There must be only one exterior LineString with a clockwise winding order. There may be one or more interior LineStrings with a counterclockwise winding orders. The last point in the polygon will not match the first point.

func (Polygon) LinearRings

func (p Polygon) LinearRings() [][][2]float64

LinearRings returns the coordinates of the linear rings

func (*Polygon) SetLinearRings

func (p *Polygon) SetLinearRings(input [][][2]float64) (err error)

SetLinearRings modifies the array of 2D coordinates

type PolygonSetter

type PolygonSetter interface {
	Polygoner
	SetLinearRings([][][2]float64) error
}

PolygonSetter is a mutable Polygoner.

type Polygoner

type Polygoner interface {
	Geometry
	LinearRings() [][][2]float64
}

Polygoner is a geometry consisting of multiple Linear Rings. There must be only one exterior LineString with a clockwise winding order. There may be one or more interior LineStrings with a counterclockwise winding orders. It is assumed that the last point is connected to the first point, and the first point is NOT duplicated at the end.

Directories

Path Synopsis
wkb
Package wkb is for decoding ESRI's Well Known Binary (WKB) format for OGC geometry (WKBGeometry) sepcification at http://edndoc.esri.com/arcsde/9.1/general_topics/wkb_representation.htm There are a few types supported by the specification.
Package wkb is for decoding ESRI's Well Known Binary (WKB) format for OGC geometry (WKBGeometry) sepcification at http://edndoc.esri.com/arcsde/9.1/general_topics/wkb_representation.htm There are a few types supported by the specification.
wkt
wkt/internal/cmd/fuzz/fuzz
Package fuzz provides primitives to generate random geom geometry types.
Package fuzz provides primitives to generate random geom geometry types.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL