Documentation ¶
Overview ¶
Package geom describes geometry interfaces.
Index ¶
- Constants
- Variables
- func IsColinear(a, b, c [2]float64) bool
- func IsNil(a interface{}) bool
- func RoundToPrec(v float64, prec int) float64
- type Circle
- type ClockwiseFunc
- type Collection
- type CollectionSetter
- type Collectioner
- type ErrUnknownGeometry
- type Extent
- func (e *Extent) Add(extent MinMaxer)
- func (e *Extent) AddGeometry(g Geometry) error
- func (e *Extent) AddPointers(pts ...Pointer)
- func (e *Extent) AddPoints(points ...[2]float64)
- func (e *Extent) Area() float64
- func (e *Extent) AsPolygon() Polygon
- func (e *Extent) Clone() *Extent
- func (e *Extent) Contains(ne MinMaxer) bool
- func (e *Extent) ContainsGeom(g Geometry) (bool, error)
- func (e *Extent) ContainsLine(l [2][2]float64) bool
- func (e *Extent) ContainsPoint(pt [2]float64) bool
- func (e *Extent) Edges(cwfn ClockwiseFunc) [][2][2]float64
- func (e *Extent) ExpandBy(s float64) *Extent
- func (e *Extent) Extent() [4]float64
- func (e *Extent) Intersect(ne *Extent) (*Extent, bool)
- func (e *Extent) IsUniverse() bool
- func (e *Extent) Max() Point
- func (e *Extent) MaxX() float64
- func (e *Extent) MaxY() float64
- func (e *Extent) Min() Point
- func (e *Extent) MinX() float64
- func (e *Extent) MinY() float64
- func (e *Extent) ScaleBy(s float64) *Extent
- func (e *Extent) Vertices() [][2]float64
- func (e *Extent) XSpan() float64
- func (e *Extent) YSpan() float64
- type Extenter
- type Geometry
- type Line
- func (l Line) ContainsPoint(pt [2]float64) bool
- func (l Line) ContainsPointBigFloat(pt [2]*big.Float) bool
- func (l Line) IsHorizontal() bool
- func (l Line) IsVertical() bool
- func (l Line) LengthSquared() float64
- func (l Line) Point1() *Point
- func (l Line) Point2() *Point
- func (l Line) Vertices() [][2]float64
- type LineM
- type LineString
- type LineStringM
- type LineStringMS
- type LineStringMSSetter
- type LineStringMSer
- type LineStringMSetter
- type LineStringMer
- type LineStringS
- type LineStringSSetter
- type LineStringSer
- type LineStringSetter
- type LineStringZ
- type LineStringZM
- type LineStringZMS
- type LineStringZMSSetter
- type LineStringZMSer
- type LineStringZMSetter
- type LineStringZMer
- type LineStringZS
- type LineStringZSSetter
- type LineStringZSer
- type LineStringZSetter
- type LineStringZer
- type LineStringer
- type LineZ
- type LineZM
- type MinMaxer
- type MultiLineString
- type MultiLineStringM
- type MultiLineStringMS
- type MultiLineStringMSSetter
- type MultiLineStringMSer
- type MultiLineStringMSetter
- type MultiLineStringMer
- type MultiLineStringS
- type MultiLineStringSSetter
- type MultiLineStringSer
- type MultiLineStringSetter
- type MultiLineStringZ
- type MultiLineStringZM
- type MultiLineStringZMS
- type MultiLineStringZMSSetter
- type MultiLineStringZMSer
- type MultiLineStringZMSetter
- type MultiLineStringZMer
- type MultiLineStringZS
- type MultiLineStringZSSetter
- type MultiLineStringZSer
- type MultiLineStringZSetter
- type MultiLineStringZer
- type MultiLineStringer
- type MultiPoint
- type MultiPointM
- type MultiPointMS
- type MultiPointMSSetter
- type MultiPointMSer
- type MultiPointMSetter
- type MultiPointMer
- type MultiPointS
- type MultiPointSSetter
- type MultiPointSer
- type MultiPointSetter
- type MultiPointZ
- type MultiPointZM
- type MultiPointZMS
- type MultiPointZMSSetter
- type MultiPointZMSer
- type MultiPointZMSetter
- type MultiPointZMer
- type MultiPointZS
- type MultiPointZSSetter
- type MultiPointZSer
- type MultiPointZSetter
- type MultiPointZer
- type MultiPointer
- type MultiPolygon
- type MultiPolygonSetter
- type MultiPolygoner
- type Point
- func (p Point) Area() float64
- func (p Point) CrossProduct(pt Point) float64
- func (p Point) Lat() float64
- func (p Point) Lon() float64
- func (p Point) Magnitude() float64
- func (p Point) MaxX() float64
- func (p Point) MaxY() float64
- func (p Point) MinX() float64
- func (p Point) MinY() float64
- func (p Point) Multiply(pt Point) Point
- func (p *Point) SetXY(xy [2]float64) (err error)
- func (p Point) Subtract(pt Point) Point
- func (p Point) WithinCircle(a, b, c Point) bool
- func (p Point) X() float64
- func (p Point) XY() [2]float64
- func (p Point) Y() float64
- type PointM
- type PointMS
- type PointMSSetter
- type PointMSer
- type PointMSetter
- type PointMer
- type PointS
- type PointSSetter
- type PointSer
- type PointSetter
- type PointZ
- type PointZM
- type PointZMS
- type PointZMSSetter
- type PointZMSer
- type PointZMSetter
- type PointZMer
- type PointZS
- type PointZSSetter
- type PointZSer
- type PointZSetter
- type PointZer
- type Pointer
- type Polygon
- type PolygonM
- type PolygonMS
- type PolygonMSSetter
- type PolygonMSer
- type PolygonMSetter
- type PolygonMer
- type PolygonS
- type PolygonSSetter
- type PolygonSer
- type PolygonSetter
- type PolygonZ
- type PolygonZM
- type PolygonZMS
- type PolygonZMSSetter
- type PolygonZMSer
- type PolygonZMSetter
- type PolygonZMer
- type PolygonZS
- type PolygonZSSetter
- type PolygonZSer
- type PolygonZSetter
- type PolygonZer
- type Polygoner
- type PtMinMaxer
- type Triangle
Constants ¶
const (
// PrecisionLevelBigFloat is the precision of big floats, rounding if over
PrecisionLevelBigFloat = 20
)
Variables ¶
var EmptyPoint = Point{nan, nan}
EmptyPoint describes an empty 2D point object.
var ErrInvalidLineString = errors.New("geom: invalid LineString")
ErrInvalidLineString is thrown when a LineString is malformed
var ErrInvalidLineStringM = errors.New("geom: invalid LineStringM")
ErrInvalidLineStringM is thrown when a LineStringM is malformed
var ErrInvalidLineStringMS = errors.New("geom: invalid LineStringMS")
ErrInvalidLineStringMS is thrown when a LineStringMS is malformed
var ErrInvalidLineStringS = errors.New("geom: invalid LineStringS")
ErrInvalidLineStringS is thrown when a LineStringS is malformed
var ErrInvalidLineStringZ = errors.New("geom: invalid LineStringZ")
ErrInvalidLineStringZ is thrown when a LineStringZ is malformed
var ErrInvalidLineStringZM = errors.New("geom: invalid LineStringZM")
ErrInvalidLineStringZM is thrown when a LineStringZM is malformed
var ErrInvalidLineStringZMS = errors.New("geom: invalid LineStringZMS")
ErrInvalidLineStringZMS is thrown when a LineStringZMS is malformed
var ErrInvalidLineStringZS = errors.New("geom: invalid LineStringZS")
ErrInvalidLineStringZS is thrown when a LineStringZS is malformed
var ErrInvalidLinearRing = errors.New("geom: invalid LinearRing")
ErrInvalidLinearRing is thrown when a LinearRing is malformed
var ErrInvalidLinearRingM = errors.New("geom: invalid LinearRingM")
ErrInvalidLinearRingM is thrown when a LinearRingM is malformed
var ErrInvalidLinearRingMS = errors.New("geom: invalid LinearRingMS")
ErrInvalidLinearRingMS is thrown when a LinearRingMS is malformed
var ErrInvalidLinearRingS = errors.New("geom: invalid LinearRingS")
ErrInvalidLinearRingS is thrown when a LinearRingS is malformed
var ErrInvalidLinearRingZ = errors.New("geom: invalid LinearRingZ")
ErrInvalidLinearRingZ is thrown when a LinearRingZ is malformed
var ErrInvalidLinearRingZM = errors.New("geom: invalid LinearRingZM")
ErrInvalidLinearRingZM is thrown when a LinearRingZM is malformed
var ErrInvalidLinearRingZMS = errors.New("geom: invalid LinearRingZMS")
ErrInvalidLinearRingZMS is thrown when a LinearRingZMS is malformed
var ErrInvalidLinearRingZS = errors.New("geom: invalid LinearRingZS")
ErrInvalidLinearRingZS is thrown when a LinearRingZS is malformed
var ErrInvalidPolygon = errors.New("geom: invalid Polygon")
ErrInvalidPolygon is thrown when a Polygon is malformed
var ErrInvalidPolygonM = errors.New("geom: invalid PolygonM")
ErrInvalidPolygonM is thrown when a Polygon is malformed
var ErrInvalidPolygonMS = errors.New("geom: invalid PolygonMS")
ErrInvalidPolygonMS is thrown when a Polygon is malformed
var ErrInvalidPolygonS = errors.New("geom: invalid PolygonS")
ErrInvalidPolygonS is thrown when a Polygon is malformed
var ErrInvalidPolygonZ = errors.New("geom: invalid PolygonZ")
ErrInvalidPolygonZ is thrown when a Polygon is malformed
var ErrInvalidPolygonZM = errors.New("geom: invalid PolygonZM")
ErrInvalidPolygonZM is thrown when a Polygon is malformed
var ErrInvalidPolygonZMS = errors.New("geom: invalid PolygonZMS")
ErrInvalidPolygonZMS is thrown when a Polygon is malformed
var ErrInvalidPolygonZS = errors.New("geom: invalid PolygonZS")
ErrInvalidPolygonZS is thrown when a Polygon is malformed
var ErrNilCollection = errors.New("geom: nil collection")
ErrNilCollection is thrown when a collection is nil but shouldn't be
var ErrNilLineString = errors.New("geom: nil LineString")
ErrNilLineString is thrown when a LineString is nil but shouldn't be
var ErrNilLineStringM = errors.New("geom: nil LineStringM")
ErrNilLineStringM is thrown when a LineStringM is nil but shouldn't be
var ErrNilLineStringMS = errors.New("geom: nil LineStringMS")
ErrNilLineStringMS is thrown when a LineStringS is nil but shouldn't be
var ErrNilLineStringS = errors.New("geom: nil LineStringS")
ErrNilLineStringS is thrown when a LineStringS is nil but shouldn't be
var ErrNilLineStringZ = errors.New("geom: nil LineStringZ")
ErrNilLineStringZ is thrown when a LineStringZ is nil but shouldn't be
var ErrNilLineStringZM = errors.New("geom: nil LineStringZM")
ErrNilLineStringZM is thrown when a LineStringZM is nil but shouldn't be
var ErrNilLineStringZMS = errors.New("geom: nil LineStringZMS")
ErrNilLineStringZMS is thrown when a LineStringZMS is nil but shouldn't be
var ErrNilLineStringZS = errors.New("geom: nil LineStringZS")
ErrNilLineStringZS is thrown when a LineStringS is nil but shouldn't be
var ErrNilMultiLineString = errors.New("geom: nil MultiLineString")
ErrNilMultiLineString is thrown when MultiLineString is nil but shouldn't be
var ErrNilMultiLineStringM = errors.New("geom: nil MultiLineStringM")
ErrNilMultiLineStringM is thrown when MultiLineStringM is nil but shouldn't be
var ErrNilMultiLineStringMS = errors.New("geom: nil MultiLineStringMS")
ErrNilMultiLineStringMS is thrown when MultiLineStringMS is nil but shouldn't be
var ErrNilMultiLineStringS = errors.New("geom: nil MultiLineStringS")
ErrNilMultiLineStringS is thrown when MultiLineStringS is nil but shouldn't be
var ErrNilMultiLineStringZ = errors.New("geom: nil MultiLineStringZ")
ErrNilMultiLineStringZ is thrown when MultiLineStringZ is nil but shouldn't be
var ErrNilMultiLineStringZM = errors.New("geom: nil MultiLineStringZM")
ErrNilMultiLineStringZM is thrown when MultiLineStringZM is nil but shouldn't be
var ErrNilMultiLineStringZMS = errors.New("geom: nil MultiLineStringZMS")
ErrNilMultiLineStringZMS is thrown when MultiLineStringZMS is nil but shouldn't be
var ErrNilMultiLineStringZS = errors.New("geom: nil MultiLineStringZS")
ErrNilMultiLineStringZS is thrown when MultiLineStringZS is nil but shouldn't be
var ErrNilMultiPoint = errors.New("geom: nil MultiPoint")
ErrNilMultiPoint is thrown when a MultiPoint is nil but shouldn't be
var ErrNilMultiPointM = errors.New("geom: nil MultiPointM")
ErrNilMultiPointM is thrown when a MultiPointM is nil but shouldn't be
var ErrNilMultiPointMS = errors.New("geom: nil MultiPointMS")
ErrNilMultiPointMS is thrown when a MultiPointMS is nil but shouldn't be
var ErrNilMultiPointS = errors.New("geom: nil MultiPointS")
ErrNilMultiPointS is thrown when a MultiPointS is nil but shouldn't be
var ErrNilMultiPointZ = errors.New("geom: nil MultiPointZ")
ErrNilMultiPointZ is thrown when a MultiPointZ is nil but shouldn't be
var ErrNilMultiPointZM = errors.New("geom: nil MultiPointZM")
ErrNilMultiPointZM is thrown when a MultiPointZM is nil but shouldn't be
var ErrNilMultiPointZMS = errors.New("geom: nil MultiPointZMS")
ErrNilMultiPointZMS is thrown when a MultiPointZMS is nil but shouldn't be
var ErrNilMultiPointZS = errors.New("geom: nil MultiPointZS")
ErrNilMultiPointZS is thrown when a MultiPointZS is nil but shouldn't be
var ErrNilMultiPolygon = errors.New("geom: nil MultiPolygon")
ErrNilMultiPolygon is thrown when a MultiPolygon is nul but shouldn't be
var ErrNilPoint = errors.New("geom: nil Point")
ErrNilPoint is thrown when a point is null but shouldn't be
var ErrNilPointM = errors.New("geom: nil PointM")
ErrNilPointM is thrown when a point is null but shouldn't be
var ErrNilPointMS = errors.New("geom: nil PointMS")
ErrNilPointMS is thrown when a point is null but shouldn't be
var ErrNilPointS = errors.New("geom: nil PointS")
ErrNilPointS is thrown when a point is null but shouldn't be
var ErrNilPointZ = errors.New("geom: nil PointZ")
ErrNilPointZ is thrown when a point is null but shouldn't be
var ErrNilPointZM = errors.New("geom: nil PointZM")
ErrNilPointZM is thrown when a point is null but shouldn't be
var ErrNilPointZMS = errors.New("geom: nil PointZMS")
ErrNilPointZMS is thrown when a point is null but shouldn't be
var ErrNilPointZS = errors.New("geom: nil PointZS")
ErrNilPointZS is thrown when a point is null but shouldn't be
var ErrNilPolygon = errors.New("geom: nil Polygon")
ErrNilPolygon is thrown when a polygon is nil but shouldn't be
var ErrNilPolygonM = errors.New("geom: nil PolygonM")
ErrNilPolygonM is thrown when a polygonz is nil but shouldn't be
var ErrNilPolygonMS = errors.New("geom: nil PolygonMS")
ErrNilPolygonMS is thrown when a polygonz is nil but shouldn't be
var ErrNilPolygonS = errors.New("geom: nil PolygonS")
ErrNilPolygonS is thrown when a polygonz is nil but shouldn't be
var ErrNilPolygonZ = errors.New("geom: nil PolygonZ")
ErrNilPolygonZ is thrown when a polygonz is nil but shouldn't be
var ErrNilPolygonZM = errors.New("geom: nil PolygonZM")
ErrNilPolygonZM is thrown when a polygonz is nil but shouldn't be
var ErrNilPolygonZMS = errors.New("geom: nil PolygonZMS")
ErrNilPolygonZMS is thrown when a polygonz is nil but shouldn't be
var ErrNilPolygonZS = errors.New("geom: nil PolygonZS")
ErrNilPolygonZS is thrown when a polygonz is nil but shouldn't be
var ErrPointsAreCoLinear = errors.New("given points are colinear")
ErrPointsAreCoLinear is thrown when points are colinear but that is unexpected
Functions ¶
func IsColinear ¶
IsColinear returns weather the a,b,c are colinear to each other
func IsNil ¶
func IsNil(a interface{}) bool
IsNil is a helper function to check it the given interface is nil, or the value store in it is nil
func RoundToPrec ¶
RoundToPrec will round the given value to the precision value. The precision value should be a power of 10.
Types ¶
type Circle ¶
Circle is a point (float tuple) and a radius
func CircleFromPoints ¶
CircleFromPoints returns the circle from by the given points, or an error if the points are colinear. REF: Formula used gotten from http://mathforum.org/library/drmath/view/55233.html
func (Circle) AsLineString ¶
func (c Circle) AsLineString(k uint) LineString
func (Circle) AsSegments ¶
AsSegments takes the number of segments that should be returned to describe the circle. a value less then 3 will use the default value of 30.
func (Circle) ContainsPoint ¶
ContainsPoint will check to see if the point is in the circle.
type ClockwiseFunc ¶
ClockwiseFunc returns weather the set of points should be considered clockwise or counterclockwise. The last point is not the same as the first point, and the function should connect these points as needed.
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 ErrUnknownGeometry ¶
type ErrUnknownGeometry struct {
Geom Geometry
}
ErrUnknownGeometry represents an objects that is not a known geom geometry.
func (ErrUnknownGeometry) Error ¶
func (e ErrUnknownGeometry) Error() string
type Extent ¶
type Extent [4]float64
Extent represents the minx, miny, maxx and maxy A nil extent represents the whole universe.
func NewExtent ¶
NewExtent returns an Extent for the provided points; in following format [4]float64{ MinX, MinY, MaxX, MaxY }
func NewExtentFromGeometry ¶
NewExtentFromGeometry tries to create an extent based on the geometry
func NewExtentFromPoints ¶
NewExtentFromPoints returns an Extent for the provided points; in following format [4]float64{ MinX, MinY, MaxX, MaxY }
func (*Extent) AddGeometry ¶
AddGeometry expands the specified envelop to contain g.
func (*Extent) AddPointers ¶
AddPointers will expand the Extent if a point is outside it
func (*Extent) ContainsGeom ¶
ContainsGeom will return weather the given geometry is completely inside of the extent.
func (*Extent) ContainsLine ¶
ContainsLine will return weather the given line completely inside of the extent.
func (*Extent) ContainsPoint ¶
ContainsPoint will return whether the given point is inside of the extent.
func (*Extent) Edges ¶
func (e *Extent) Edges(cwfn ClockwiseFunc) [][2][2]float64
Edges returns the clockwise order of the edges that make up the extent.
func (*Extent) Intersect ¶
Intersect will return a new extent that is the intersect of the two extents.
+-------------------------+ | | | A +----------+------+ | |//////////| | | |/// C ////| | | |//////////| | +--------------+----------+ | | B | +-----------------+
For example the for the above Box A intersects Box B at the area surround by C.
If the Boxes don't intersect does will be false, otherwise ibb will be the intersect.
func (*Extent) IsUniverse ¶
IsUniverse returns weather the extent contains the universe. This is true if the clip box is nil or the x,y values are max values.
func (*Extent) Vertices ¶
Vertices return the vertices of the Bounding Box. The vertices are ordered in the following maner. (minx,miny), (maxx,miny), (maxx,maxy), (minx,maxy)
type Extenter ¶
type Extenter interface {
Extent() (extent [4]float64)
}
Extenter represents an interface that returns a boundbox.
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 - we define here also the extended Z, M and ZM versions which refer respectively to PointZ, PointM and PointZM geometries
func ExtractLines ¶
ExtractLines extracts all linear components from a geometry (line segements). If the geometry contains no line segements (e.g. empty geometry or point), then an empty array will be returned.
Duplicate lines will not be removed.
func (Line) ContainsPoint ¶
ContainsPoint checks to see if the given pont lines on the linesegment. (Incliding the end points.)
func (Line) ContainsPointBigFloat ¶
ContainsPointBigFloat checks to see if the given point lies on the line segment. (Including the endpoints.)
func (Line) IsHorizontal ¶
IsHorizontal returns true if the `x` elements of the points that make the line (l) are equal.
func (Line) IsVertical ¶
IsVertical returns true if the `y` elements of the points that make up the line (l) are equal.
func (Line) LengthSquared ¶
LengthSqured returns the length of the segment squared
type LineString ¶
type LineString [][2]float64
LineString is a basic line type which is made up of two or more points that don't interacted.
func (LineString) AsSegments ¶
func (ls LineString) AsSegments() (segs []Line, err error)
AsSegments returns the line string as a slice of lines.
func (LineString) IsRing ¶
func (ls LineString) IsRing() bool
IsRing returns true if the first and last vertices are the same
func (*LineString) SetVertices ¶
func (ls *LineString) SetVertices(input [][2]float64) (err error)
SetVertices modifies the array of 2D coordinates
func (LineString) Vertices ¶
func (ls LineString) Vertices() [][2]float64
Vertices returns a slice of XY values
type LineStringM ¶
type LineStringM [][3]float64
LineString is a basic line type which is made up of two or more points that don't interacted.
func (LineStringM) LineString ¶
func (lsm LineStringM) LineString() LineString
Get the simple 2D linestring
func (*LineStringM) SetVertices ¶
func (lsm *LineStringM) SetVertices(input [][3]float64) (err error)
SetVertices modifies the array of 2D+1 coordinates
func (LineStringM) Vertices ¶
func (lsm LineStringM) Vertices() [][3]float64
Vertices returns a slice of XYM values
type LineStringMS ¶
type LineStringMS struct { Srid uint32 Lsm LineStringM }
LineStringMS is a basic line type which is made up of two or more points that don't interacted.
func (LineStringMS) LineStringM ¶
func (lsms LineStringMS) LineStringM() LineStringM
Get the simple 2D + 1 linestring
func (*LineStringMS) SetSRID ¶
func (lsms *LineStringMS) SetSRID(srid uint32, lsm LineStringM) (err error)
SetVertices modifies the struct containing the SRID int and the array of 2D + 1 coordinates
func (LineStringMS) Vertices ¶
func (lsms LineStringMS) Vertices() struct { Srid uint32 Lsm LineStringM }
Vertices returns a slice of referenced XYM values
type LineStringMSSetter ¶
type LineStringMSSetter interface { LineStringMSer SetSRID(srid uint32, lsm LineStringM) error }
LineStringMSSetter is a mutable LineStringMSer.
type LineStringMSer ¶
type LineStringMSer interface { Geometry Vertices() struct { Srid uint32 Lsm LineStringM } }
LineStringMSer is a line of two or more M points + SRID.
type LineStringMSetter ¶
type LineStringMSetter interface { LineStringMer SetVertices([][3]float64) error }
LineStringMSetter is a mutable LineStringMer.
type LineStringMer ¶
LineStringMer is a line of two or more M points.
type LineStringS ¶
type LineStringS struct { Srid uint32 Ls LineString }
LineString is a basic line type which is made up of two or more points that don't interacted.
func (LineStringS) LineString ¶
func (lss LineStringS) LineString() LineString
Get the simple 2D linestring
func (*LineStringS) SetSRID ¶
func (lss *LineStringS) SetSRID(srid uint32, ls LineString) (err error)
SetVertices modifies the struct containing the SRID int and the array of 2D coordinates
func (LineStringS) Vertices ¶
func (lss LineStringS) Vertices() struct { Srid uint32 Ls LineString }
Vertices returns a slice of referenced XY values
type LineStringSSetter ¶
type LineStringSSetter interface { LineStringSer SetSRID(srid uint32, ls LineString) error }
LineStringSSetter is a mutable LineStringSer.
type LineStringSer ¶
type LineStringSer interface { Geometry Vertices() struct { Srid uint32 Ls LineString } }
LineStringSer is a line of two or more points + SRID.
type LineStringSetter ¶
type LineStringSetter interface { LineStringer SetVertices([][2]float64) error }
LineStringSetter is a mutable LineStringer.
type LineStringZ ¶
type LineStringZ [][3]float64
LineString is a basic line type which is made up of two or more points that don't interacted.
func (LineStringZ) LineString ¶
func (lsz LineStringZ) LineString() LineString
Get the simple 2D linestring
func (*LineStringZ) SetVertices ¶
func (lsz *LineStringZ) SetVertices(input [][3]float64) (err error)
SetVertices modifies the array of 3D coordinates
func (LineStringZ) Vertices ¶
func (lsz LineStringZ) Vertices() [][3]float64
Vertices returns a slice of XYM values
type LineStringZM ¶
type LineStringZM [][4]float64
LineString is a basic line type which is made up of two or more points that don't interacted.
func (LineStringZM) LineString ¶
func (lszm LineStringZM) LineString() LineString
Get the simple 2D linestring
func (*LineStringZM) SetVertices ¶
func (lszm *LineStringZM) SetVertices(input [][4]float64) (err error)
SetVertices modifies the array of 3D + 1 coordinates
func (LineStringZM) Vertices ¶
func (lszm LineStringZM) Vertices() [][4]float64
Vertices returns a slice of XYM values
type LineStringZMS ¶
type LineStringZMS struct { Srid uint32 Lszm LineStringZM }
LineStringZMS is a basic line type which is made up of two or more points that don't interacted.
func (LineStringZMS) LineStringZM ¶
func (lszms LineStringZMS) LineStringZM() LineStringZM
Get the simple 3D + 1 linestring
func (*LineStringZMS) SetSRID ¶
func (lszms *LineStringZMS) SetSRID(srid uint32, lszm LineStringZM) (err error)
SetVertices modifies the struct containing the SRID int and the array of 3D + 1 coordinates
func (LineStringZMS) Vertices ¶
func (lszms LineStringZMS) Vertices() struct { Srid uint32 Lszm LineStringZM }
Vertices returns a slice of referenced XYZM values
type LineStringZMSSetter ¶
type LineStringZMSSetter interface { LineStringZMSer SetSRID(srid uint32, lszm LineStringZM) error }
LineStringZMSSetter is a mutable LineStringZMSer.
type LineStringZMSer ¶
type LineStringZMSer interface { Geometry Vertices() struct { Srid uint32 Lszm LineStringZM } }
LineStringZMSer is a line of two or more ZM points + SRID.
type LineStringZMSetter ¶
type LineStringZMSetter interface { LineStringZMer SetVertices([][4]float64) error }
LineStringZMSetter is a mutable LineStringZMer.
type LineStringZMer ¶
LineStringZMer is a line of two or more ZM points.
type LineStringZS ¶
type LineStringZS struct { Srid uint32 Lsz LineStringZ }
LineStringZS is a basic line type which is made up of two or more points that don't interacted.
func (LineStringZS) LineStringZ ¶
func (lszs LineStringZS) LineStringZ() LineStringZ
Get the simple 3D linestring
func (*LineStringZS) SetSRID ¶
func (lszs *LineStringZS) SetSRID(srid uint32, lsz LineStringZ) (err error)
SetVertices modifies the struct containing the SRID int and the array of 3D coordinates
func (LineStringZS) Vertices ¶
func (lszs LineStringZS) Vertices() struct { Srid uint32 Lsz LineStringZ }
Vertices returns a slice of referenced XYM values
type LineStringZSSetter ¶
type LineStringZSSetter interface { LineStringZSer SetSRID(srid uint32, lsz LineStringZ) error }
LineStringZSSetter is a mutable LineStringZSer.
type LineStringZSer ¶
type LineStringZSer interface { Geometry Vertices() struct { Srid uint32 Lsz LineStringZ } }
LineStringZSer is a line of two or more Z points + SRID.
type LineStringZSetter ¶
type LineStringZSetter interface { LineStringZer SetVertices([][3]float64) error }
LineStringZSetter is a mutable LineStringZer.
type LineStringZer ¶
LineStringZer is a line of two or more Z points.
type LineStringer ¶
LineStringer is a line of two or more points.
type LineZ ¶
type LineZ [2][3]float64
type MultiLineString ¶
type MultiLineString [][][2]float64
MultiLineString is a geometry with multiple LineStrings.
func (MultiLineString) AsSegments ¶
func (mls MultiLineString) AsSegments() (segs [][]Line, err error)
AsSegments returns the multi lines string as a set of lines.
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 MultiLineStringM ¶
type MultiLineStringM [][][3]float64
MultiLineStringM is a geometry with multiple LineStringMs.
func (MultiLineStringM) AsLineStringMs ¶
func (mlsm MultiLineStringM) AsLineStringMs() (segs []LineStringM, err error)
AsSegments returns the multi lines string as a set of lineMs.
func (MultiLineStringM) LineStringMs ¶
func (mlsm MultiLineStringM) LineStringMs() [][][3]float64
LineStringMs returns the coordinates for the linestrings
func (*MultiLineStringM) SetLineStringMs ¶
func (mlsm *MultiLineStringM) SetLineStringMs(input [][][3]float64) (err error)
SetLineStringZs modifies the array of 2D+1D coordinates
type MultiLineStringMS ¶
type MultiLineStringMS struct { Srid uint32 Mlsm MultiLineStringM }
MultiLineStringMS is a geometry with multiple LineStringSs.
func (MultiLineStringMS) MultiLineStringM ¶
func (mlsms MultiLineStringMS) MultiLineStringM() MultiLineStringM
Get the simple 2D+1 multiline string
func (MultiLineStringMS) MultiLineStringMs ¶
func (mlsms MultiLineStringMS) MultiLineStringMs() struct { Srid uint32 Mlsm MultiLineStringM }
LineStrings returns the coordinates for the linestrings
func (*MultiLineStringMS) SetSRID ¶
func (mlsms *MultiLineStringMS) SetSRID(srid uint32, mlsm MultiLineStringM) (err error)
SetSRID modifies the struct containing the SRID int and the array of 2D+1 coordinates
type MultiLineStringMSSetter ¶
type MultiLineStringMSSetter interface { MultiLineStringMSer SetSRID(srid uint32, mlsm MultiLineStringM) error }
MultiLineStringMSSetter is a mutable MultiLineMSStringer.
type MultiLineStringMSer ¶
type MultiLineStringMSer interface { Geometry MultiLineStringMs() struct { Srid uint32 Mlsm MultiLineStringM } }
MultiLineMSStringer is a geometry with multiple LineMSStrings.
type MultiLineStringMSetter ¶
type MultiLineStringMSetter interface { MultiLineStringMer SetLineStringMs([][][3]float64) error }
MultiLineStringMSetter is a mutable MultiLineStringMer.
type MultiLineStringMer ¶
MultiLineMStringer is a geometry with multiple LineMStrings.
type MultiLineStringS ¶
type MultiLineStringS struct { Srid uint32 Mls MultiLineString }
MultiLineStringS is a geometry with multiple LineStringSs.
func (MultiLineStringS) MultiLineString ¶
func (mlss MultiLineStringS) MultiLineString() MultiLineString
Get the simple 2D multiline string
func (MultiLineStringS) MultiLineStrings ¶
func (mlss MultiLineStringS) MultiLineStrings() struct { Srid uint32 Mls MultiLineString }
LineStrings returns the coordinates for the linestrings
func (*MultiLineStringS) SetSRID ¶
func (mlss *MultiLineStringS) SetSRID(srid uint32, mls MultiLineString) (err error)
SetSRID modifies the struct containing the SRID int and the array of 2D coordinates
type MultiLineStringSSetter ¶
type MultiLineStringSSetter interface { MultiLineStringSer SetSRID(srid uint32, mls MultiLineString) error }
MultiLineStringSSetter is a mutable MultiLineSStringer.
type MultiLineStringSer ¶
type MultiLineStringSer interface { Geometry MultiLineStrings() struct { Srid uint32 Mls MultiLineString } }
MultiLineSStringer is a geometry with multiple LineSStrings.
type MultiLineStringSetter ¶
type MultiLineStringSetter interface { MultiLineStringer SetLineStrings([][][2]float64) error }
MultiLineStringSetter is a mutable MultiLineStringer.
type MultiLineStringZ ¶
type MultiLineStringZ [][][3]float64
MultiLineStringZ is a geometry with multiple LineStringZs.
func (MultiLineStringZ) AsLineStringZs ¶
func (mlsz MultiLineStringZ) AsLineStringZs() (segs []LineStringZ, err error)
AsSegments returns the multi lines string as a set of lineZs.
func (MultiLineStringZ) LineStringZs ¶
func (mlsz MultiLineStringZ) LineStringZs() [][][3]float64
LineStringZs returns the coordinates for the linestrings
func (*MultiLineStringZ) SetLineStringZs ¶
func (mlsz *MultiLineStringZ) SetLineStringZs(input [][][3]float64) (err error)
SetLineStringZs modifies the array of 3D coordinates
type MultiLineStringZM ¶
type MultiLineStringZM [][][4]float64
MultiLineStringZM is a geometry with multiple LineStringZMs.
func (MultiLineStringZM) AsLineStringZMs ¶
func (mlszm MultiLineStringZM) AsLineStringZMs() (segs []LineStringZM, err error)
AsSegments returns the multi lines string as a set of lineZMs.
func (MultiLineStringZM) LineStringZMs ¶
func (mlszm MultiLineStringZM) LineStringZMs() [][][4]float64
LineStringZMs returns the coordinates for the linestrings
func (*MultiLineStringZM) SetLineStringZMs ¶
func (mlszm *MultiLineStringZM) SetLineStringZMs(input [][][4]float64) (err error)
SetLineStringZMs modifies the array of 3D+1D coordinates
type MultiLineStringZMS ¶
type MultiLineStringZMS struct { Srid uint32 Mlszm MultiLineStringZM }
MultiLineStringZMS is a geometry with multiple LineStringSs.
func (MultiLineStringZMS) MultiLineStringZM ¶
func (mlszms MultiLineStringZMS) MultiLineStringZM() MultiLineStringZM
Get the simple 3D+1 multiline string
func (MultiLineStringZMS) MultiLineStringZMs ¶
func (mlszms MultiLineStringZMS) MultiLineStringZMs() struct { Srid uint32 Mlszm MultiLineStringZM }
LineStrings returns the coordinates for the linestrings
func (*MultiLineStringZMS) SetSRID ¶
func (mlszms *MultiLineStringZMS) SetSRID(srid uint32, mlszm MultiLineStringZM) (err error)
SetSRID modifies the struct containing the SRID int and the array of 3D+1 coordinates
type MultiLineStringZMSSetter ¶
type MultiLineStringZMSSetter interface { MultiLineStringZMSer SetSRID(srid uint32, mlszm MultiLineStringZM) error }
MultiLineStringZMSSetter is a mutable MultiLineZMSStringer.
type MultiLineStringZMSer ¶
type MultiLineStringZMSer interface { Geometry MultiLineStringZMs() struct { Srid uint32 Mlszm MultiLineStringZM } }
MultiLineZMSStringer is a geometry with multiple LineZMSStrings.
type MultiLineStringZMSetter ¶
type MultiLineStringZMSetter interface { MultiLineStringZMer SetLineStringZMs([][][4]float64) error }
MultiLineStringZMSetter is a mutable MultiLineZMStringer.
type MultiLineStringZMer ¶
MultiLineZMStringer is a geometry with multiple LineZMStrings.
type MultiLineStringZS ¶
type MultiLineStringZS struct { Srid uint32 Mlsz MultiLineStringZ }
MultiLineStringZS is a geometry with multiple LineStringSs.
func (MultiLineStringZS) MultiLineStringZ ¶
func (mlszs MultiLineStringZS) MultiLineStringZ() MultiLineStringZ
Get the simple 3D multiline string
func (MultiLineStringZS) MultiLineStringZs ¶
func (mlszs MultiLineStringZS) MultiLineStringZs() struct { Srid uint32 Mlsz MultiLineStringZ }
LineStrings returns the coordinates for the linestrings
func (*MultiLineStringZS) SetSRID ¶
func (mlszs *MultiLineStringZS) SetSRID(srid uint32, mlsz MultiLineStringZ) (err error)
SetSRID modifies the struct containing the SRID int and the array of 3D coordinates
type MultiLineStringZSSetter ¶
type MultiLineStringZSSetter interface { MultiLineStringZSer SetSRID(srid uint32, mlsz MultiLineStringZ) error }
MultiLineStringZSSetter is a mutable MultiLineZSStringer.
type MultiLineStringZSer ¶
type MultiLineStringZSer interface { Geometry MultiLineStringZs() struct { Srid uint32 Mlsz MultiLineStringZ } }
MultiLineZSStringer is a geometry with multiple LineZSStrings.
type MultiLineStringZSetter ¶
type MultiLineStringZSetter interface { MultiLineStringZer SetLineStringZs([][][3]float64) error }
MultiLineStringZSetter is a mutable MultiLineStringZer.
type MultiLineStringZer ¶
MultiLineZStringer is a geometry with multiple LineZStrings.
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 MultiPointM ¶
type MultiPointM [][3]float64
MultiPointM is a geometry with multiple 2+1D points.
func (MultiPointM) MultiPoint ¶
func (mpm MultiPointM) MultiPoint() MultiPoint
Get the simple 2D multipoint
func (MultiPointM) Points ¶
func (mpm MultiPointM) Points() [][3]float64
Points returns the coordinates for the 2+1D points
func (*MultiPointM) SetPoints ¶
func (mpm *MultiPointM) SetPoints(input [][3]float64) (err error)
SetPoints modifies the array of 2+1D coordinates
type MultiPointMS ¶
type MultiPointMS struct { Srid uint32 Mpm MultiPointM }
MultiPointMS is a geometry with multiple, referenced 2+1D points.
func (MultiPointMS) MultiPointM ¶
func (mpms MultiPointMS) MultiPointM() MultiPointM
Get the simple 3D multipoint
func (MultiPointMS) Points ¶
func (mpms MultiPointMS) Points() struct { Srid uint32 Mpm MultiPointM }
Points returns the coordinates for the 3D points
func (*MultiPointMS) SetSRID ¶
func (mpms *MultiPointMS) SetSRID(srid uint32, mpm MultiPointM) (err error)
SetSRID modifies the struct containing the SRID int and the array of 3D coordinates
type MultiPointMSSetter ¶
type MultiPointMSSetter interface { MultiPointMSer SetSRID(srid uint32, mpz MultiPointM) error }
MultiPointMSSetter is a mutable MultiPointMSer.
type MultiPointMSer ¶
type MultiPointMSer interface { Geometry Points() struct { Srid uint32 Mpm MultiPointM } }
MultiPointMSer is a MultiPointM + SRID.
type MultiPointMSetter ¶
type MultiPointMSetter interface { MultiPointMer SetPoints([][3]float64) error }
MultiPointMSetter is a mutable MultiPointer.
type MultiPointMer ¶
MultiPointMer is a geometry with multiple 2+1D points.
type MultiPointS ¶
type MultiPointS struct { Srid uint32 Mp MultiPoint }
MultiPointS is a geometry with multiple, referenced 2D points.
func (MultiPointS) MultiPoint ¶
func (mps MultiPointS) MultiPoint() MultiPoint
Get the simple 2D multipoint
func (MultiPointS) Points ¶
func (mps MultiPointS) Points() struct { Srid uint32 Mp MultiPoint }
Points returns the coordinates for the 2D points
func (*MultiPointS) SetSRID ¶
func (mps *MultiPointS) SetSRID(srid uint32, mp MultiPoint) (err error)
SetSRID modifies the struct containing the SRID int and the array of 2D coordinates
type MultiPointSSetter ¶
type MultiPointSSetter interface { MultiPointSer SetSRID(srid uint32, mp MultiPoint) error }
MultiPointSSetter is a mutable MultiPointSer.
type MultiPointSer ¶
type MultiPointSer interface { Geometry Points() struct { Srid uint32 Mp MultiPoint } }
MultiPointSer is a MultiPoint + SRID.
type MultiPointSetter ¶
type MultiPointSetter interface { MultiPointer SetPoints([][2]float64) error }
MultiPointSetter is a mutable MultiPointer.
type MultiPointZ ¶
type MultiPointZ [][3]float64
MultiPointZ is a geometry with multiple 3D points.
func (MultiPointZ) MultiPoint ¶
func (mpz MultiPointZ) MultiPoint() MultiPoint
Get the simple 2D multipoint
func (MultiPointZ) Points ¶
func (mpz MultiPointZ) Points() [][3]float64
Points returns the coordinates for the 3D points
func (*MultiPointZ) SetPoints ¶
func (mpz *MultiPointZ) SetPoints(input [][3]float64) (err error)
SetPoints modifies the array of 3D coordinates
type MultiPointZM ¶
type MultiPointZM [][4]float64
MultiPointZM is a geometry with multiple 3+1D points.
func (MultiPointZM) MultiPoint ¶
func (mpzm MultiPointZM) MultiPoint() MultiPoint
Get the simple 2D multipoint
func (MultiPointZM) Points ¶
func (mpzm MultiPointZM) Points() [][4]float64
Points returns the coordinates for the 3+1D points
func (*MultiPointZM) SetPoints ¶
func (mpzm *MultiPointZM) SetPoints(input [][4]float64) (err error)
SetPoints modifies the array of 3+1D coordinates
type MultiPointZMS ¶
type MultiPointZMS struct { Srid uint32 Mpzm MultiPointZM }
MultiPointZMS is a geometry with multiple, referenced 3+1D points.
func (MultiPointZMS) MultiPointZM ¶
func (mpzms MultiPointZMS) MultiPointZM() MultiPointZM
Get the simple 3D multipoint
func (MultiPointZMS) Points ¶
func (mpzms MultiPointZMS) Points() struct { Srid uint32 Mpzm MultiPointZM }
Points returns the coordinates for the 3+1D points
func (*MultiPointZMS) SetSRID ¶
func (mpzms *MultiPointZMS) SetSRID(srid uint32, mpzm MultiPointZM) (err error)
SetSRID modifies the struct containing the SRID int and the array of 3+1D coordinates
type MultiPointZMSSetter ¶
type MultiPointZMSSetter interface { MultiPointZMSer SetSRID(srid uint32, mpzm MultiPointZM) error }
MultiPointZMSSetter is a mutable MultiPointZMSer.
type MultiPointZMSer ¶
type MultiPointZMSer interface { Geometry Points() struct { Srid uint32 Mpzm MultiPointZM } }
MultiPointZMSer is a MultiPointZM + SRID.
type MultiPointZMSetter ¶
type MultiPointZMSetter interface { MultiPointZMer SetPoints([][4]float64) error }
MultiPointZMSetter is a mutable MultiPointer.
type MultiPointZMer ¶
MultiPointZMer is a geometry with multiple 3+1D points.
type MultiPointZS ¶
type MultiPointZS struct { Srid uint32 Mpz MultiPointZ }
MultiPointZS is a geometry with multiple, referenced 3D points.
func (MultiPointZS) MultiPointZ ¶
func (mps MultiPointZS) MultiPointZ() MultiPointZ
Get the simple 3D multipoint
func (MultiPointZS) Points ¶
func (mpzs MultiPointZS) Points() struct { Srid uint32 Mpz MultiPointZ }
Points returns the coordinates for the 3D points
func (*MultiPointZS) SetSRID ¶
func (mpzs *MultiPointZS) SetSRID(srid uint32, mpz MultiPointZ) (err error)
SetSRID modifies the struct containing the SRID int and the array of 3D coordinates
type MultiPointZSSetter ¶
type MultiPointZSSetter interface { MultiPointZSer SetSRID(srid uint32, mpz MultiPointZ) error }
MultiPointZSSetter is a mutable MultiPointZSer.
type MultiPointZSer ¶
type MultiPointZSer interface { Geometry Points() struct { Srid uint32 Mpz MultiPointZ } }
MultiPointZSer is a MultiPointZ + SRID.
type MultiPointZSetter ¶
type MultiPointZSetter interface { MultiPointZer SetPoints([][3]float64) error }
MultiPointZSetter is a mutable MultiPointer.
type MultiPointZer ¶
MultiPointZer is a geometry with multiple 3D points.
type MultiPointer ¶
MultiPointer is a geometry with multiple points.
type MultiPolygon ¶
type MultiPolygon [][][][2]float64
MultiPolygon is a geometry of multiple polygons.
func (MultiPolygon) AsSegments ¶
func (mp MultiPolygon) AsSegments() (segs [][][]Line, err error)
AsSegments return a set of []Line
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
func GetCoordinates ¶
GetCoordinates return a list of points that make up a geometry. This makes no attempt to remove duplicate points.
func (Point) CrossProduct ¶
CrossProduct will return the cross product of the p and pt.
func (Point) WithinCircle ¶
WithinCircle indicates weather the point p is contained the the circle defined by a,b,c REF: See Guibas and Stolf (1985) p.107
type PointM ¶
type PointM [3]float64
Point describes a simple 2D+1D point
type PointMS ¶
Point describes a simple 3D point with SRID
type PointMSSetter ¶
PointMSSetter is a mutable PointMer
type PointMSetter ¶
PointMSetter is a mutable PointMer
type PointS ¶
Point describes a simple 2D point with SRID
type PointSSetter ¶
PointSSetter is a mutable PointSer
type PointSetter ¶
PointSetter is a mutable Pointer.
type PointZ ¶
type PointZ [3]float64
Point describes a simple 3D point
type PointZM ¶
type PointZM [4]float64
Point describes a simple 3D+1D point
type PointZMS ¶
Point describes a simple 3D+1D point with SRID
type PointZMSSetter ¶
type PointZMSSetter interface { PointZMSer SetXYZMS(srid uint32, xyzm PointZM) error }
PointZMSSetter is a mutable PointZMer
type PointZMSer ¶
PointZMSer is a 3D+1D point + SRID
type PointZMSetter ¶
PointZMSetter is a mutable PointZMer
type PointZS ¶
Point describes a simple 3D point with SRID
type PointZSSetter ¶
PointZSSetter is a mutable PointZSer
type PointZSetter ¶
PointZSetter is a mutable PointZer
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 linear ring will not match the first point.
func (Polygon) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (Polygon) LinearRings ¶
LinearRings returns the coordinates of the linear rings
func (*Polygon) SetLinearRings ¶
SetLinearRings modifies the array of 2D coordinates
type PolygonM ¶
type PolygonM [][][3]float64
PolygonM is a geometry consisting of multiple closed LineStringMs. There must be only one exterior LineStringM with a clockwise winding order. There may be one or more interior LineStringMs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonM) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonM) LinearRings ¶
LinearRings returns the coordinates of the linear rings
func (*PolygonM) SetLinearRings ¶
SetLinearRingZs modifies the array of 2D+1 coordinates
type PolygonMS ¶
PolygonMS is a geometry consisting of multiple closed LineStringMSs. There must be only one exterior LineStringMS with a clockwise winding order. There may be one or more interior LineStringMSs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonMS) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonMS) LinearRings ¶
LinearRings returns the coordinates of the linear rings
type PolygonMSSetter ¶
type PolygonMSer ¶
type PolygonMSetter ¶
type PolygonMSetter interface { PolygonMer SetLinearRings([][][3]float64) error AsSegments() ([][]LineM, error) }
type PolygonMer ¶
type PolygonS ¶
PolygonS is a geometry consisting of multiple closed LineStringSs. There must be only one exterior LineStringS with a clockwise winding order. There may be one or more interior LineStringSs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonS) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonS) LinearRings ¶
LinearRings returns the coordinates of the linear rings
type PolygonSSetter ¶
type PolygonSer ¶
type PolygonSetter ¶
type PolygonSetter interface { Polygoner SetLinearRings([][][2]float64) error AsSegments() ([][]Line, error) }
PolygonSetter is a mutable Polygoner.
type PolygonZ ¶
type PolygonZ [][][3]float64
PolygonZ is a geometry consisting of multiple closed LineStringZs. There must be only one exterior LineStringZ with a clockwise winding order. There may be one or more interior LineStringZs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonZ) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonZ) LinearRings ¶
LinearRings returns the coordinates of the linear rings
func (*PolygonZ) SetLinearRings ¶
SetLinearRingZs modifies the array of 3D coordinates
type PolygonZM ¶
type PolygonZM [][][4]float64
PolygonZM is a geometry consisting of multiple closed LineStringZMs. There must be only one exterior LineStringZM with a clockwise winding order. There may be one or more interior LineStringZMs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonZM) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonZM) LinearRings ¶
LinearRings returns the coordinates of the linear rings
func (*PolygonZM) SetLinearRings ¶
SetLinearRingZs modifies the array of 3D coordinates
type PolygonZMS ¶
PolygonZMS is a geometry consisting of multiple closed LineStringZMSs. There must be only one exterior LineStringZMS with a clockwise winding order. There may be one or more interior LineStringZMSs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonZMS) AsSegments ¶
func (p PolygonZMS) AsSegments() (segs [][]LineZM, srid uint32, err error)
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonZMS) LinearRings ¶
func (p PolygonZMS) LinearRings() struct { Srid uint32 Polzm PolygonZM }
LinearRings returns the coordinates of the linear rings
func (*PolygonZMS) SetLinearRings ¶
func (p *PolygonZMS) SetLinearRings(srid uint32, polzm PolygonZM) (err error)
SetLinearRingMs modifies the array of 3D coordinates
type PolygonZMSSetter ¶
type PolygonZMSer ¶
type PolygonZMSetter ¶
type PolygonZMSetter interface { PolygonZMer SetLinearRings([][][4]float64) error AsSegments() ([][]LineZM, error) }
type PolygonZMer ¶
type PolygonZS ¶
PolygonZS is a geometry consisting of multiple closed LineStringZSs. There must be only one exterior LineStringZS with a clockwise winding order. There may be one or more interior LineStringZSs with a counterclockwise winding orders. The last point in the linear ring will not match the first point.
func (PolygonZS) AsSegments ¶
AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.
func (PolygonZS) LinearRings ¶
LinearRings returns the coordinates of the linear rings
type PolygonZSSetter ¶
type PolygonZSer ¶
type PolygonZSetter ¶
type PolygonZSetter interface { PolygonZer SetLinearRings([][][3]float64) error AsSegments() ([][]LineZ, error) }
type PolygonZer ¶
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.
type PtMinMaxer ¶
type Triangle ¶
type Triangle [3][2]float64
Triangle is a array representation of a geometry triangle.
func NewTriangleContaining ¶
NewTriangleContaining returns a triangle that is large enough to contain the given points
func NewTriangleFromPolygon ¶
NewTriangleFromPolygon takes the first three points from the outer ring of a polygon to create a triangle.
func (Triangle) Area ¶
Area reaturns twice the area of the oriented triangle (a,b,c), i.e. the area is positive if the triangle is oriented counterclockwise.
func (Triangle) LinearRings ¶
LinearRings returns the coordinates of the linear rings
func (Triangle) ThirdPoint ¶
ThirdPoint takes 2 points and checks which point is the 3rd in the Triangle
Source Files ¶
- bbox.go
- circle.go
- collection.go
- debug.go
- errors.go
- geom.go
- line.go
- line_string.go
- line_stringm.go
- line_stringms.go
- line_strings.go
- line_stringz.go
- line_stringzm.go
- line_stringzms.go
- line_stringzs.go
- multi_line_string.go
- multi_line_stringm.go
- multi_line_stringms.go
- multi_line_strings.go
- multi_line_stringz.go
- multi_line_stringzm.go
- multi_line_stringzms.go
- multi_line_stringzs.go
- multi_point.go
- multi_pointm.go
- multi_pointms.go
- multi_points.go
- multi_pointz.go
- multi_pointzm.go
- multi_pointzms.go
- multi_pointzs.go
- multi_polygon.go
- point.go
- pointm.go
- pointms.go
- points.go
- pointz.go
- pointzm.go
- pointzms.go
- pointzs.go
- polygon.go
- polygonm.go
- polygonms.go
- polygons.go
- polygonz.go
- polygonzm.go
- polygonzms.go
- polygonzs.go
- set_geom.go
- triangle.go
- utils.go
Directories ¶
Path | Synopsis |
---|---|
geojson
Package geojson implements encoding and decoding of GeoJSON as defined in [RFC 7946](https://tools.ietf.org/html/rfc7946).
|
Package geojson implements encoding and decoding of GeoJSON as defined in [RFC 7946](https://tools.ietf.org/html/rfc7946). |
mvt
Package mvt is used to encode MVT tiles
|
Package mvt is used to encode MVT tiles |
mvt/vector_tile
Package vectorTile is a generated protocol buffer package.
|
Package vectorTile is a generated protocol buffer package. |
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
|
|
debugger
Package debugger provides a way for us to capture partial geometries during geometry processing.
|
Package debugger provides a way for us to capture partial geometries during geometry processing. |
rtreego
Package rtreego is a library for efficiently storing and querying spatial data.
|
Package rtreego is a library for efficiently storing and querying spatial data. |
coord/utm
Package utm provides the ability to work with UTM coordinates
|
Package utm provides the ability to work with UTM coordinates |
index/kdtree
kdtree is a two dimensional kd-tree implementation
|
kdtree is a two dimensional kd-tree implementation |
triangulate/delaunay/quadedge
Package quadedge describes a quadedge object used to build up the triangulation A quadedge is made up of four directional edges
|
Package quadedge describes a quadedge object used to build up the triangulation A quadedge is made up of four directional edges |
testing
|
|
must
Package must provides helpers to decode wkt geometries to be used in tests
|
Package must provides helpers to decode wkt geometries to be used in tests |
Package winding provides primitives for determining the winding order of a set of points
|
Package winding provides primitives for determining the winding order of a set of points |