Documentation ¶
Overview ¶
Package geom describes geometry interfaces.
Index ¶
- Variables
- type BoundingBox
- func (bb *BoundingBox) Add(bbox BoundingBox)
- func (bb *BoundingBox) AddPoints(points ...[2]float64)
- func (bb BoundingBox) BottomLeft() [2]float64
- func (bb BoundingBox) BottomRight() [2]float64
- func (bb *BoundingBox) Contains(pt [2]float64) (v bool)
- func (bb BoundingBox) Edges() [][2][2]float64
- func (bb BoundingBox) LREdges() [][2][2]float64
- func (bb BoundingBox) MaxX() float64
- func (bb BoundingBox) MaxY() float64
- func (bb BoundingBox) MinX() float64
- func (bb BoundingBox) MinY() float64
- func (bb BoundingBox) TopLeft() [2]float64
- func (bb BoundingBox) TopRight() [2]float64
- func (bb BoundingBox) Verticies() [][2]float64
- type BoundingBoxer
- type Collection
- type CollectionSetter
- type Collectioner
- type Geometry
- type Line
- type LineString
- type LineStringSetter
- type LineStringer
- type MultiLineString
- type MultiLineStringSetter
- type MultiLineStringer
- type MultiPoint
- type MultiPointSetter
- type MultiPointer
- type MultiPolygon
- type MultiPolygonSetter
- type MultiPolygoner
- type Point
- type PointSetter
- type Pointer
- type Polygon
- type PolygonSetter
- type Polygoner
Constants ¶
This section is empty.
Variables ¶
var ErrNilCollection = errors.New("geom: nil collection")
var ErrNilLineString = errors.New("geom: nil LineString")
var ErrNilMultiLineString = errors.New("geom: nil MultiLineString")
var ErrNilMultiPoint = errors.New("geom: nil MultiPoint")
var ErrNilMultiPolygon = errors.New("geom: nil MultiPolygon")
var ErrNilPoint = errors.New("geom: nil Point")
var ErrNilPolygon = errors.New("geom: nil Polygon")
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) 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 ¶
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 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 ¶
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 ¶
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 ¶
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 ¶
MultiPolygoner is a geometry of multiple polygons.
type Point ¶
type Point [2]float64
Point describes a simple 2D point
type PointSetter ¶
PointSetter is a mutable Pointer.
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 ¶
LinearRings returns the coordinates of the linear rings
func (*Polygon) SetLinearRings ¶
SetLinearRings modifies the array of 2D coordinates
type PolygonSetter ¶
PolygonSetter is a mutable Polygoner.
type Polygoner ¶
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.
Source Files ¶
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/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
|
|