geom: github.com/go-spatial/geom Index | Files | Directories

package geom

import "github.com/go-spatial/geom"

Package geom describes geometry interfaces.

Index

Package 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 set_geom.go triangle.go utils.go

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 ErrInvalidPolygon = errors.New("geom: invalid Polygon")

ErrInvalidPolygon 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 ErrPointsAreCoLinear = errors.New("given points are colinear")

ErrPointsAreCoLinear is thrown when points are colinear but that is unexpected

func IsColinear Uses

func IsColinear(a, b, c [2]float64) bool

IsColinear returns weather the a,b,c are colinear to each other

func IsEmpty Uses

func IsEmpty(geo Geometry) bool

IsEmpty returns if the geometry represents an empty geometry

func RoundToPrec Uses

func RoundToPrec(v float64, prec int) float64

RoundToPrec will round the given value to the precision value. The precision value should be a power of 10.

type Circle Uses

type Circle struct {
    Center [2]float64
    Radius float64
}

Circle is a point (float tuple) and a radius

func CircleFromPoints Uses

func CircleFromPoints(a, b, c [2]float64) (Circle, error)

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 Uses

func (c Circle) AsLineString(k uint) LineString

func (Circle) AsPoints Uses

func (c Circle) AsPoints(k uint) []Point

func (Circle) AsSegments Uses

func (c Circle) AsSegments(k uint) []Line

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 Uses

func (c Circle) ContainsPoint(pt [2]float64) bool

ContainsPoint will check to see if the point is in the circle.

type ClockwiseFunc Uses

type ClockwiseFunc func(...[2]float64) bool

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 Uses

type Collection []Geometry

Collection is a collection of one or more geometries.

func (Collection) Geometries Uses

func (c Collection) Geometries() []Geometry

Geometries returns the slice of Geometries

func (*Collection) SetGeometries Uses

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

SetGeometries modifies the array of 2D coordinates

type CollectionSetter Uses

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

CollectionSetter is a mutable Collectioner.

type Collectioner Uses

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

Collectioner is a collections of different geometries.

type ErrUnknownGeometry Uses

type ErrUnknownGeometry struct {
    Geom Geometry
}

ErrUnknownGeometry represents an objects that is not a known geom geometry.

func (ErrUnknownGeometry) Error Uses

func (e ErrUnknownGeometry) Error() string

type Extent Uses

type Extent [4]float64

Extent represents the minx, miny, maxx and maxy A nil extent represents the whole universe.

func NewExtent Uses

func NewExtent(points ...[2]float64) *Extent

NewExtent returns an Extent for the provided points; in following format [4]float64{ MinX, MinY, MaxX, MaxY }

func NewExtentFromGeometry Uses

func NewExtentFromGeometry(g Geometry) (*Extent, error)

NewExtentFromGeometry tries to create an extent based on the geometry

func NewExtentFromPoints Uses

func NewExtentFromPoints(points ...Point) *Extent

NewExtentFromPoints returns an Extent for the provided points; in following format [4]float64{ MinX, MinY, MaxX, MaxY }

func (*Extent) Add Uses

func (e *Extent) Add(extent MinMaxer)

Add will expand the extent to contain the given extent.

func (*Extent) AddGeometry Uses

func (e *Extent) AddGeometry(g Geometry) error

AddGeometry expands the specified envelop to contain g.

func (*Extent) AddPointers Uses

func (e *Extent) AddPointers(pts ...Pointer)

AddPointers will expand the Extent if a point is outside it

func (*Extent) AddPoints Uses

func (e *Extent) AddPoints(points ...[2]float64)

AddPoints will expand the extent to contain the given points.

func (*Extent) Area Uses

func (e *Extent) Area() float64

Area returns the area of the extent, if the extent is nil, it will return 0

func (*Extent) AsPolygon Uses

func (e *Extent) AsPolygon() Polygon

AsPolygon will return the extent as a Polygon

func (*Extent) Clone Uses

func (e *Extent) Clone() *Extent

Clone returns a new Extent with contents copied.

func (*Extent) Contains Uses

func (e *Extent) Contains(ne MinMaxer) bool

Contains will return whether the given extent is inside of the extent.

func (*Extent) ContainsGeom Uses

func (e *Extent) ContainsGeom(g Geometry) (bool, error)

ContainsGeom will return weather the given geometry is completely inside of the extent.

func (*Extent) ContainsLine Uses

func (e *Extent) ContainsLine(l [2][2]float64) bool

ContainsLine will return weather the given line completely inside of the extent.

func (*Extent) ContainsPoint Uses

func (e *Extent) ContainsPoint(pt [2]float64) bool

ContainsPoint will return whether the given point is inside of the extent.

func (*Extent) Edges Uses

func (e *Extent) Edges(cwfn ClockwiseFunc) [][2][2]float64

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

func (*Extent) ExpandBy Uses

func (e *Extent) ExpandBy(s float64) *Extent

ExpandBy will expand extent by the given factor.

func (*Extent) Extent Uses

func (e *Extent) Extent() [4]float64

Extent returns back the min and max of the Extent

func (*Extent) Intersect Uses

func (e *Extent) Intersect(ne *Extent) (*Extent, bool)

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 Uses

func (e *Extent) IsUniverse() bool

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) Max Uses

func (e *Extent) Max() [2]float64

Max returns the (MaxX, MaxY) values

func (*Extent) MaxX Uses

func (e *Extent) MaxX() float64

MaxX is the larger of the x values.

func (*Extent) MaxY Uses

func (e *Extent) MaxY() float64

MaxY is the larger of the y values.

func (*Extent) Min Uses

func (e *Extent) Min() [2]float64

Min returns the (MinX, MinY) values

func (*Extent) MinX Uses

func (e *Extent) MinX() float64

MinX is the smaller of the x values.

func (*Extent) MinY Uses

func (e *Extent) MinY() float64

MinY is the smaller of the y values.

func (*Extent) ScaleBy Uses

func (e *Extent) ScaleBy(s float64) *Extent

ScaleBy will scale the points in the extent by the given scale factor.

func (*Extent) Vertices Uses

func (e *Extent) Vertices() [][2]float64

Vertices return the vertices of the Bounding Box. The vertices are ordered in the following maner. (minx,miny), (maxx,miny), (maxx,maxy), (minx,maxy)

func (*Extent) XSpan Uses

func (e *Extent) XSpan() float64

XSpan is the distance of the Extent in X or inf TODO (gdey): look at how to have this function take into account the dpi.

func (*Extent) YSpan Uses

func (e *Extent) YSpan() float64

YSpan is the distance of the Extent in Y or Inf

type Extenter Uses

type Extenter interface {
    Extent() (extent [4]float64)
}

Extenter represents an interface that returns a boundbox.

type Geometry Uses

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

func ApplyToPoints Uses

func ApplyToPoints(geometry Geometry, f func(coords ...float64) ([]float64, error)) (Geometry, error)

ApplyToPoints applys the given function to each point in the geometry and any sub geometries, return a new transformed geometry.

func Clone Uses

func Clone(geometry Geometry) (Geometry, error)

Clone returns a deep clone of the Geometry.

type Line Uses

type Line [2][2]float64

Line has exactly two points

func ExtractLines Uses

func ExtractLines(g Geometry) (lines []Line, err error)

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 Uses

func (l Line) ContainsPoint(pt [2]float64) bool

ContainsPoint checks to see if the given pont lines on the linesegment. (Incliding the end points.)

func (Line) ContainsPointBigFloat Uses

func (l Line) ContainsPointBigFloat(pt [2]*big.Float) bool

ContainsPointBigFloat checks to see if the given point lies on the line segment. (Including the endpoints.)

func (Line) IsHorizontal Uses

func (l Line) IsHorizontal() bool

IsHorizontal returns true if the `x` elements of the points that make the line (l) are equal.

func (Line) IsVertical Uses

func (l Line) IsVertical() bool

IsVertical returns true if the `y` elements of the points that make up the line (l) are equal.

func (Line) LengthSquared Uses

func (l Line) LengthSquared() float64

LengthSqured returns the length of the segment squared

func (Line) Point1 Uses

func (l Line) Point1() *Point

Point1 returns a new copy of the first point in the line.

func (Line) Point2 Uses

func (l Line) Point2() *Point

Point2 returns a new copy of the second point in the line.

func (Line) Vertices Uses

func (l Line) Vertices() [][2]float64

type LineString Uses

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 Uses

func (ls LineString) AsSegments() (segs []Line, err error)

AsSegments returns the line string as a slice of lines.

func (LineString) IsRing Uses

func (ls LineString) IsRing() bool

IsRing returns true if the first and last vertices are the same

func (*LineString) SetVertices Uses

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

SetVertices modifies the array of 2D coordinates

func (LineString) Vertices Uses

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

Vertices returns a slice of XY values

type LineStringM Uses

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 Uses

func (lsm LineStringM) LineString() LineString

Get the simple 2D linestring

func (*LineStringM) SetVertices Uses

func (lsm *LineStringM) SetVertices(input [][3]float64) (err error)

SetVertices modifies the array of 2D+1 coordinates

func (LineStringM) Vertices Uses

func (lsm LineStringM) Vertices() [][3]float64

Vertices returns a slice of XYM values

type LineStringMS Uses

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 Uses

func (lsms LineStringMS) LineStringM() LineStringM

Get the simple 2D + 1 linestring

func (*LineStringMS) SetSRID Uses

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 Uses

func (lsms LineStringMS) Vertices() struct {
    Srid uint32
    Lsm  LineStringM
}

Vertices returns a slice of referenced XYM values

type LineStringMSSetter Uses

type LineStringMSSetter interface {
    LineStringMSer
    SetSRID(srid uint32, lsm LineStringM) error
}

LineStringMSSetter is a mutable LineStringMSer.

type LineStringMSer Uses

type LineStringMSer interface {
    Geometry
    Vertices() struct {
        Srid uint32
        Lsm  LineStringM
    }
}

LineStringMSer is a line of two or more M points + SRID.

type LineStringMSetter Uses

type LineStringMSetter interface {
    LineStringMer
    SetVertices([][3]float64) error
}

LineStringMSetter is a mutable LineStringMer.

type LineStringMer Uses

type LineStringMer interface {
    Geometry
    Vertices() [][3]float64
}

LineStringMer is a line of two or more M points.

type LineStringS Uses

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 Uses

func (lss LineStringS) LineString() LineString

Get the simple 2D linestring

func (*LineStringS) SetSRID Uses

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 Uses

func (lss LineStringS) Vertices() struct {
    Srid uint32
    Ls   LineString
}

Vertices returns a slice of referenced XY values

type LineStringSSetter Uses

type LineStringSSetter interface {
    LineStringSer
    SetSRID(srid uint32, ls LineString) error
}

LineStringSSetter is a mutable LineStringSer.

type LineStringSer Uses

type LineStringSer interface {
    Geometry
    Vertices() struct {
        Srid uint32
        Ls   LineString
    }
}

LineStringSer is a line of two or more points + SRID.

type LineStringSetter Uses

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

LineStringSetter is a mutable LineStringer.

type LineStringZ Uses

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 Uses

func (lsz LineStringZ) LineString() LineString

Get the simple 2D linestring

func (*LineStringZ) SetVertices Uses

func (lsz *LineStringZ) SetVertices(input [][3]float64) (err error)

SetVertices modifies the array of 3D coordinates

func (LineStringZ) Vertices Uses

func (lsz LineStringZ) Vertices() [][3]float64

Vertices returns a slice of XYM values

type LineStringZM Uses

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 Uses

func (lszm LineStringZM) LineString() LineString

Get the simple 2D linestring

func (*LineStringZM) SetVertices Uses

func (lszm *LineStringZM) SetVertices(input [][4]float64) (err error)

SetVertices modifies the array of 3D + 1 coordinates

func (LineStringZM) Vertices Uses

func (lszm LineStringZM) Vertices() [][4]float64

Vertices returns a slice of XYM values

type LineStringZMS Uses

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 Uses

func (lszms LineStringZMS) LineStringZM() LineStringZM

Get the simple 3D + 1 linestring

func (*LineStringZMS) SetSRID Uses

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 Uses

func (lszms LineStringZMS) Vertices() struct {
    Srid uint32
    Lszm LineStringZM
}

Vertices returns a slice of referenced XYZM values

type LineStringZMSSetter Uses

type LineStringZMSSetter interface {
    LineStringZMSer
    SetSRID(srid uint32, lszm LineStringZM) error
}

LineStringZMSSetter is a mutable LineStringZMSer.

type LineStringZMSer Uses

type LineStringZMSer interface {
    Geometry
    Vertices() struct {
        Srid uint32
        Lszm LineStringZM
    }
}

LineStringZMSer is a line of two or more ZM points + SRID.

type LineStringZMSetter Uses

type LineStringZMSetter interface {
    LineStringZMer
    SetVertices([][4]float64) error
}

LineStringZMSetter is a mutable LineStringZMer.

type LineStringZMer Uses

type LineStringZMer interface {
    Geometry
    Vertices() [][4]float64
}

LineStringZMer is a line of two or more ZM points.

type LineStringZS Uses

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 Uses

func (lszs LineStringZS) LineStringZ() LineStringZ

Get the simple 3D linestring

func (*LineStringZS) SetSRID Uses

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 Uses

func (lszs LineStringZS) Vertices() struct {
    Srid uint32
    Lsz  LineStringZ
}

Vertices returns a slice of referenced XYM values

type LineStringZSSetter Uses

type LineStringZSSetter interface {
    LineStringZSer
    SetSRID(srid uint32, lsz LineStringZ) error
}

LineStringZSSetter is a mutable LineStringZSer.

type LineStringZSer Uses

type LineStringZSer interface {
    Geometry
    Vertices() struct {
        Srid uint32
        Lsz  LineStringZ
    }
}

LineStringZSer is a line of two or more Z points + SRID.

type LineStringZSetter Uses

type LineStringZSetter interface {
    LineStringZer
    SetVertices([][3]float64) error
}

LineStringZSetter is a mutable LineStringZer.

type LineStringZer Uses

type LineStringZer interface {
    Geometry
    Vertices() [][3]float64
}

LineStringZer is a line of two or more Z points.

type LineStringer Uses

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

LineStringer is a line of two or more points.

type MinMaxer Uses

type MinMaxer interface {
    MinX() float64
    MinY() float64
    MaxX() float64
    MaxY() float64
}

MinMaxer is a wrapper for an Extent that gets min/max of the extent

type MultiLineString Uses

type MultiLineString [][][2]float64

MultiLineString is a geometry with multiple LineStrings.

func (MultiLineString) AsSegments Uses

func (mls MultiLineString) AsSegments() (segs [][]Line, err error)

AsSegments returns the multi lines string as a set of lines.

func (MultiLineString) LineStrings Uses

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

LineStrings returns the coordinates for the linestrings

func (*MultiLineString) SetLineStrings Uses

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

SetLineStrings modifies the array of 2D coordinates

type MultiLineStringM Uses

type MultiLineStringM [][][3]float64

MultiLineStringM is a geometry with multiple LineStringMs.

func (MultiLineStringM) AsLineStringMs Uses

func (mlsm MultiLineStringM) AsLineStringMs() (segs []LineStringM, err error)

AsSegments returns the multi lines string as a set of lineMs.

func (MultiLineStringM) LineStringMs Uses

func (mlsm MultiLineStringM) LineStringMs() [][][3]float64

LineStringMs returns the coordinates for the linestrings

func (*MultiLineStringM) SetLineStringMs Uses

func (mlsm *MultiLineStringM) SetLineStringMs(input [][][3]float64) (err error)

SetLineStringZs modifies the array of 2D+1D coordinates

type MultiLineStringMS Uses

type MultiLineStringMS struct {
    Srid uint32
    Mlsm MultiLineStringM
}

MultiLineStringMS is a geometry with multiple LineStringSs.

func (MultiLineStringMS) MultiLineStringM Uses

func (mlsms MultiLineStringMS) MultiLineStringM() MultiLineStringM

Get the simple 2D+1 multiline string

func (MultiLineStringMS) MultiLineStringMs Uses

func (mlsms MultiLineStringMS) MultiLineStringMs() struct {
    Srid uint32
    Mlsm MultiLineStringM
}

LineStrings returns the coordinates for the linestrings

func (*MultiLineStringMS) SetSRID Uses

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 Uses

type MultiLineStringMSSetter interface {
    MultiLineStringMSer
    SetSRID(srid uint32, mlsm MultiLineStringM) error
}

MultiLineStringMSSetter is a mutable MultiLineMSStringer.

type MultiLineStringMSer Uses

type MultiLineStringMSer interface {
    Geometry
    MultiLineStringMs() struct {
        Srid uint32
        Mlsm MultiLineStringM
    }
}

MultiLineMSStringer is a geometry with multiple LineMSStrings.

type MultiLineStringMSetter Uses

type MultiLineStringMSetter interface {
    MultiLineStringMer
    SetLineStringMs([][][3]float64) error
}

MultiLineStringMSetter is a mutable MultiLineStringMer.

type MultiLineStringMer Uses

type MultiLineStringMer interface {
    Geometry
    LineStringMs() [][][3]float64
}

MultiLineMStringer is a geometry with multiple LineMStrings.

type MultiLineStringS Uses

type MultiLineStringS struct {
    Srid uint32
    Mls  MultiLineString
}

MultiLineStringS is a geometry with multiple LineStringSs.

func (MultiLineStringS) MultiLineString Uses

func (mlss MultiLineStringS) MultiLineString() MultiLineString

Get the simple 2D multiline string

func (MultiLineStringS) MultiLineStrings Uses

func (mlss MultiLineStringS) MultiLineStrings() struct {
    Srid uint32
    Mls  MultiLineString
}

LineStrings returns the coordinates for the linestrings

func (*MultiLineStringS) SetSRID Uses

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 Uses

type MultiLineStringSSetter interface {
    MultiLineStringSer
    SetSRID(srid uint32, mls MultiLineString) error
}

MultiLineStringSSetter is a mutable MultiLineSStringer.

type MultiLineStringSer Uses

type MultiLineStringSer interface {
    Geometry
    MultiLineStrings() struct {
        Srid uint32
        Mls  MultiLineString
    }
}

MultiLineSStringer is a geometry with multiple LineSStrings.

type MultiLineStringSetter Uses

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

MultiLineStringSetter is a mutable MultiLineStringer.

type MultiLineStringZ Uses

type MultiLineStringZ [][][3]float64

MultiLineStringZ is a geometry with multiple LineStringZs.

func (MultiLineStringZ) AsLineStringZs Uses

func (mlsz MultiLineStringZ) AsLineStringZs() (segs []LineStringZ, err error)

AsSegments returns the multi lines string as a set of lineZs.

func (MultiLineStringZ) LineStringZs Uses

func (mlsz MultiLineStringZ) LineStringZs() [][][3]float64

LineStringZs returns the coordinates for the linestrings

func (*MultiLineStringZ) SetLineStringZs Uses

func (mlsz *MultiLineStringZ) SetLineStringZs(input [][][3]float64) (err error)

SetLineStringZs modifies the array of 3D coordinates

type MultiLineStringZM Uses

type MultiLineStringZM [][][4]float64

MultiLineStringZM is a geometry with multiple LineStringZMs.

func (MultiLineStringZM) AsLineStringZMs Uses

func (mlszm MultiLineStringZM) AsLineStringZMs() (segs []LineStringZM, err error)

AsSegments returns the multi lines string as a set of lineZMs.

func (MultiLineStringZM) LineStringZMs Uses

func (mlszm MultiLineStringZM) LineStringZMs() [][][4]float64

LineStringZMs returns the coordinates for the linestrings

func (*MultiLineStringZM) SetLineStringZMs Uses

func (mlszm *MultiLineStringZM) SetLineStringZMs(input [][][4]float64) (err error)

SetLineStringZMs modifies the array of 3D+1D coordinates

type MultiLineStringZMS Uses

type MultiLineStringZMS struct {
    Srid  uint32
    Mlszm MultiLineStringZM
}

MultiLineStringZMS is a geometry with multiple LineStringSs.

func (MultiLineStringZMS) MultiLineStringZM Uses

func (mlszms MultiLineStringZMS) MultiLineStringZM() MultiLineStringZM

Get the simple 3D+1 multiline string

func (MultiLineStringZMS) MultiLineStringZMs Uses

func (mlszms MultiLineStringZMS) MultiLineStringZMs() struct {
    Srid  uint32
    Mlszm MultiLineStringZM
}

LineStrings returns the coordinates for the linestrings

func (*MultiLineStringZMS) SetSRID Uses

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 Uses

type MultiLineStringZMSSetter interface {
    MultiLineStringZMSer
    SetSRID(srid uint32, mlszm MultiLineStringZM) error
}

MultiLineStringZMSSetter is a mutable MultiLineZMSStringer.

type MultiLineStringZMSer Uses

type MultiLineStringZMSer interface {
    Geometry
    MultiLineStringZMs() struct {
        Srid  uint32
        Mlszm MultiLineStringZM
    }
}

MultiLineZMSStringer is a geometry with multiple LineZMSStrings.

type MultiLineStringZMSetter Uses

type MultiLineStringZMSetter interface {
    MultiLineStringZMer
    SetLineStringZMs([][][4]float64) error
}

MultiLineStringZMSetter is a mutable MultiLineZMStringer.

type MultiLineStringZMer Uses

type MultiLineStringZMer interface {
    Geometry
    LineStringZMs() [][][4]float64
}

MultiLineZMStringer is a geometry with multiple LineZMStrings.

type MultiLineStringZS Uses

type MultiLineStringZS struct {
    Srid uint32
    Mlsz MultiLineStringZ
}

MultiLineStringZS is a geometry with multiple LineStringSs.

func (MultiLineStringZS) MultiLineStringZ Uses

func (mlszs MultiLineStringZS) MultiLineStringZ() MultiLineStringZ

Get the simple 3D multiline string

func (MultiLineStringZS) MultiLineStringZs Uses

func (mlszs MultiLineStringZS) MultiLineStringZs() struct {
    Srid uint32
    Mlsz MultiLineStringZ
}

LineStrings returns the coordinates for the linestrings

func (*MultiLineStringZS) SetSRID Uses

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 Uses

type MultiLineStringZSSetter interface {
    MultiLineStringZSer
    SetSRID(srid uint32, mlsz MultiLineStringZ) error
}

MultiLineStringZSSetter is a mutable MultiLineZSStringer.

type MultiLineStringZSer Uses

type MultiLineStringZSer interface {
    Geometry
    MultiLineStringZs() struct {
        Srid uint32
        Mlsz MultiLineStringZ
    }
}

MultiLineZSStringer is a geometry with multiple LineZSStrings.

type MultiLineStringZSetter Uses

type MultiLineStringZSetter interface {
    MultiLineStringZer
    SetLineStringZs([][][3]float64) error
}

MultiLineStringZSetter is a mutable MultiLineStringZer.

type MultiLineStringZer Uses

type MultiLineStringZer interface {
    Geometry
    LineStringZs() [][][3]float64
}

MultiLineZStringer is a geometry with multiple LineZStrings.

type MultiLineStringer Uses

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

MultiLineStringer is a geometry with multiple LineStrings.

type MultiPoint Uses

type MultiPoint [][2]float64

MultiPoint is a geometry with multiple points.

func (MultiPoint) Points Uses

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

Points returns the coordinates for the points

func (*MultiPoint) SetPoints Uses

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

SetPoints modifies the array of 2D coordinates

type MultiPointM Uses

type MultiPointM [][3]float64

MultiPointM is a geometry with multiple 2+1D points.

func (MultiPointM) MultiPoint Uses

func (mpm MultiPointM) MultiPoint() MultiPoint

Get the simple 2D multipoint

func (MultiPointM) Points Uses

func (mpm MultiPointM) Points() [][3]float64

Points returns the coordinates for the 2+1D points

func (*MultiPointM) SetPoints Uses

func (mpm *MultiPointM) SetPoints(input [][3]float64) (err error)

SetPoints modifies the array of 2+1D coordinates

type MultiPointMS Uses

type MultiPointMS struct {
    Srid uint32
    Mpm  MultiPointM
}

MultiPointMS is a geometry with multiple, referenced 2+1D points.

func (MultiPointMS) MultiPointM Uses

func (mpms MultiPointMS) MultiPointM() MultiPointM

Get the simple 3D multipoint

func (MultiPointMS) Points Uses

func (mpms MultiPointMS) Points() struct {
    Srid uint32
    Mpm  MultiPointM
}

Points returns the coordinates for the 3D points

func (*MultiPointMS) SetSRID Uses

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 Uses

type MultiPointMSSetter interface {
    MultiPointMSer
    SetSRID(srid uint32, mpz MultiPointM) error
}

MultiPointMSSetter is a mutable MultiPointMSer.

type MultiPointMSer Uses

type MultiPointMSer interface {
    Geometry
    Points() struct {
        Srid uint32
        Mpm  MultiPointM
    }
}

MultiPointMSer is a MultiPointM + SRID.

type MultiPointMSetter Uses

type MultiPointMSetter interface {
    MultiPointMer
    SetPoints([][3]float64) error
}

MultiPointMSetter is a mutable MultiPointer.

type MultiPointMer Uses

type MultiPointMer interface {
    Geometry
    Points() [][3]float64
}

MultiPointMer is a geometry with multiple 2+1D points.

type MultiPointS Uses

type MultiPointS struct {
    Srid uint32
    Mp   MultiPoint
}

MultiPointS is a geometry with multiple, referenced 2D points.

func (MultiPointS) MultiPoint Uses

func (mps MultiPointS) MultiPoint() MultiPoint

Get the simple 2D multipoint

func (MultiPointS) Points Uses

func (mps MultiPointS) Points() struct {
    Srid uint32
    Mp   MultiPoint
}

Points returns the coordinates for the 2D points

func (*MultiPointS) SetSRID Uses

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 Uses

type MultiPointSSetter interface {
    MultiPointSer
    SetSRID(srid uint32, mp MultiPoint) error
}

MultiPointSSetter is a mutable MultiPointSer.

type MultiPointSer Uses

type MultiPointSer interface {
    Geometry
    Points() struct {
        Srid uint32
        Mp   MultiPoint
    }
}

MultiPointSer is a MultiPoint + SRID.

type MultiPointSetter Uses

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

MultiPointSetter is a mutable MultiPointer.

type MultiPointZ Uses

type MultiPointZ [][3]float64

MultiPointZ is a geometry with multiple 3D points.

func (MultiPointZ) MultiPoint Uses

func (mpz MultiPointZ) MultiPoint() MultiPoint

Get the simple 2D multipoint

func (MultiPointZ) Points Uses

func (mpz MultiPointZ) Points() [][3]float64

Points returns the coordinates for the 3D points

func (*MultiPointZ) SetPoints Uses

func (mpz *MultiPointZ) SetPoints(input [][3]float64) (err error)

SetPoints modifies the array of 3D coordinates

type MultiPointZM Uses

type MultiPointZM [][4]float64

MultiPointZM is a geometry with multiple 3+1D points.

func (MultiPointZM) MultiPoint Uses

func (mpzm MultiPointZM) MultiPoint() MultiPoint

Get the simple 2D multipoint

func (MultiPointZM) Points Uses

func (mpzm MultiPointZM) Points() [][4]float64

Points returns the coordinates for the 3+1D points

func (*MultiPointZM) SetPoints Uses

func (mpzm *MultiPointZM) SetPoints(input [][4]float64) (err error)

SetPoints modifies the array of 3+1D coordinates

type MultiPointZMS Uses

type MultiPointZMS struct {
    Srid uint32
    Mpzm MultiPointZM
}

MultiPointZMS is a geometry with multiple, referenced 3+1D points.

func (MultiPointZMS) MultiPointZM Uses

func (mpzms MultiPointZMS) MultiPointZM() MultiPointZM

Get the simple 3D multipoint

func (MultiPointZMS) Points Uses

func (mpzms MultiPointZMS) Points() struct {
    Srid uint32
    Mpzm MultiPointZM
}

Points returns the coordinates for the 3+1D points

func (*MultiPointZMS) SetSRID Uses

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 Uses

type MultiPointZMSSetter interface {
    MultiPointZMSer
    SetSRID(srid uint32, mpzm MultiPointZM) error
}

MultiPointZMSSetter is a mutable MultiPointZMSer.

type MultiPointZMSer Uses

type MultiPointZMSer interface {
    Geometry
    Points() struct {
        Srid uint32
        Mpzm MultiPointZM
    }
}

MultiPointZMSer is a MultiPointZM + SRID.

type MultiPointZMSetter Uses

type MultiPointZMSetter interface {
    MultiPointZMer
    SetPoints([][4]float64) error
}

MultiPointZMSetter is a mutable MultiPointer.

type MultiPointZMer Uses

type MultiPointZMer interface {
    Geometry
    Points() [][4]float64
}

MultiPointZMer is a geometry with multiple 3+1D points.

type MultiPointZS Uses

type MultiPointZS struct {
    Srid uint32
    Mpz  MultiPointZ
}

MultiPointZS is a geometry with multiple, referenced 3D points.

func (MultiPointZS) MultiPointZ Uses

func (mps MultiPointZS) MultiPointZ() MultiPointZ

Get the simple 3D multipoint

func (MultiPointZS) Points Uses

func (mpzs MultiPointZS) Points() struct {
    Srid uint32
    Mpz  MultiPointZ
}

Points returns the coordinates for the 3D points

func (*MultiPointZS) SetSRID Uses

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 Uses

type MultiPointZSSetter interface {
    MultiPointZSer
    SetSRID(srid uint32, mpz MultiPointZ) error
}

MultiPointZSSetter is a mutable MultiPointZSer.

type MultiPointZSer Uses

type MultiPointZSer interface {
    Geometry
    Points() struct {
        Srid uint32
        Mpz  MultiPointZ
    }
}

MultiPointZSer is a MultiPointZ + SRID.

type MultiPointZSetter Uses

type MultiPointZSetter interface {
    MultiPointZer
    SetPoints([][3]float64) error
}

MultiPointZSetter is a mutable MultiPointer.

type MultiPointZer Uses

type MultiPointZer interface {
    Geometry
    Points() [][3]float64
}

MultiPointZer is a geometry with multiple 3D points.

type MultiPointer Uses

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

MultiPointer is a geometry with multiple points.

type MultiPolygon Uses

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

MultiPolygon is a geometry of multiple polygons.

func (MultiPolygon) AsSegments Uses

func (mp MultiPolygon) AsSegments() (segs [][][]Line, err error)

AsSegments return a set of []Line

func (MultiPolygon) Polygons Uses

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

Polygons returns the array of polygons.

func (*MultiPolygon) SetPolygons Uses

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

SetPolygons modifies the array of 2D coordinates

type MultiPolygonSetter Uses

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

MultiPolygonSetter is a mutable MultiPolygoner.

type MultiPolygoner Uses

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

MultiPolygoner is a geometry of multiple polygons.

type Point Uses

type Point [2]float64

Point describes a simple 2D point

func GetCoordinates Uses

func GetCoordinates(g Geometry) (pts []Point, err error)

GetCoordinates return a list of points that make up a geometry. This makes no attempt to remove duplicate points.

func (Point) Area Uses

func (p Point) Area() float64

Area of a point is always 0

func (Point) CrossProduct Uses

func (p Point) CrossProduct(pt Point) float64

CrossProduct will return the cross product of the p and pt.

func (Point) Magnitude Uses

func (p Point) Magnitude() float64

Magnitude of the point is the size of the point

func (Point) MaxX Uses

func (p Point) MaxX() float64

MaxX is the same as X

func (Point) MaxY Uses

func (p Point) MaxY() float64

MaxY is the same as y

func (Point) MinX Uses

func (p Point) MinX() float64

MinX is the same as X

func (Point) MinY Uses

func (p Point) MinY() float64

MinY is the same as y

func (Point) Multiply Uses

func (p Point) Multiply(pt Point) Point

Multiply will return a new point that is the multiplication of pt and p

func (*Point) SetXY Uses

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

SetXY sets a pair of coordinates

func (Point) Subtract Uses

func (p Point) Subtract(pt Point) Point

Subtract will return a new point that is the subtraction of pt from p

func (Point) WithinCircle Uses

func (p Point) WithinCircle(a, b, c Point) bool

WithinCircle indicates weather the point p is contained the the circle defined by a,b,c REF: See Guibas and Stolf (1985) p.107

func (Point) X Uses

func (p Point) X() float64

X is the x coordinate of a point in the projection

func (Point) XY Uses

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

XY returns an array of 2D coordinates

func (Point) Y Uses

func (p Point) Y() float64

Y is the y coordinate of a point in the projection

type PointM Uses

type PointM [3]float64

Point describes a simple 2D+1D point

func (PointM) M Uses

func (p PointM) M() float64

M returns the metric related to the 2D point

func (*PointM) SetXYM Uses

func (p *PointM) SetXYM(xym [3]float64) (err error)

SetXYM sets the three coordinates

func (PointM) XY Uses

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

XY returns an array of 2D coordinates

func (PointM) XYM Uses

func (p PointM) XYM() [3]float64

XYM returns an array of 2D+1D coordinates

type PointMS Uses

type PointMS struct {
    Srid uint32
    Xym  PointM
}

Point describes a simple 3D point with SRID

func (PointMS) S Uses

func (p PointMS) S() uint32

S returns the srid as uint32

func (*PointMS) SetXYMS Uses

func (p *PointMS) SetXYMS(srid uint32, xym PointM) (err error)

SetXYMS sets the XYM coordinates and the SRID

func (PointMS) XYM Uses

func (p PointMS) XYM() PointM

XYM returns 3D+1D point

func (PointMS) XYMS Uses

func (p PointMS) XYMS() struct {
    Srid uint32
    Xym  PointM
}

XYMS returns the struct itself

type PointMSSetter Uses

type PointMSSetter interface {
    PointMSer
    SetXYMS(srid uint32, xym PointM) error
}

PointMSSetter is a mutable PointMer

type PointMSer Uses

type PointMSer interface {
    Geometry
    XYMS() struct {
        Srid uint32
        Xym  PointM
    }
}

PointMSer is a 2D+1D point + SRID

type PointMSetter Uses

type PointMSetter interface {
    PointMer
    SetXYM([3]float64) error
}

PointMSetter is a mutable PointMer

type PointMer Uses

type PointMer interface {
    Geometry
    XYM() [3]float64
}

PointMer is a 2D+1D point.

type PointS Uses

type PointS struct {
    Srid uint32
    Xy   Point
}

Point describes a simple 2D point with SRID

func (PointS) S Uses

func (p PointS) S() uint32

S returns the srid as uint32

func (*PointS) SetXYS Uses

func (p *PointS) SetXYS(srid uint32, xy Point) (err error)

SetXYS sets the XY coordinates and the SRID

func (PointS) XY Uses

func (p PointS) XY() Point

XY returns 2D point

func (PointS) XYS Uses

func (p PointS) XYS() struct {
    Srid uint32
    Xy   Point
}

XYS returns the struct itself

type PointSSetter Uses

type PointSSetter interface {
    PointSer
    SetXYS(srid uint32, xy Point) error
}

PointSSetter is a mutable PointSer

type PointSer Uses

type PointSer interface {
    Geometry
    XYS() struct {
        Srid uint32
        Xy   Point
    }
}

PointSer is a 2D point + SRID

type PointSetter Uses

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

PointSetter is a mutable Pointer.

type PointZ Uses

type PointZ [3]float64

Point describes a simple 3D point

func (PointZ) Magnitude Uses

func (p PointZ) Magnitude() float64

Magnitude of the point is the size of the point

func (*PointZ) SetXYZ Uses

func (p *PointZ) SetXYZ(xyz [3]float64) (err error)

SetXYZ sets the three coordinates

func (PointZ) XY Uses

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

XY returns an array of 2D coordinates

func (PointZ) XYZ Uses

func (p PointZ) XYZ() [3]float64

XYZ returns an array of 3D coordinates

type PointZM Uses

type PointZM [4]float64

Point describes a simple 3D+1D point

func (PointZM) M Uses

func (p PointZM) M() float64

M returns the metric related to the 2D point

func (*PointZM) SetXYZM Uses

func (p *PointZM) SetXYZM(xyzm [4]float64) (err error)

SetXYZM sets the three coordinates

func (PointZM) XYZ Uses

func (p PointZM) XYZ() [3]float64

XYZ returns an array of 3D coordinates

func (PointZM) XYZM Uses

func (p PointZM) XYZM() [4]float64

XYZM returns an array of 3D+1D coordinates

type PointZMS Uses

type PointZMS struct {
    Srid uint32
    Xyzm PointZM
}

Point describes a simple 3D+1D point with SRID

func (PointZMS) S Uses

func (p PointZMS) S() uint32

S returns the srid as uint32

func (*PointZMS) SetXYZMS Uses

func (p *PointZMS) SetXYZMS(srid uint32, xyzm PointZM) (err error)

SetXYZMS sets the XYZM coordinates and the SRID

func (PointZMS) XYZM Uses

func (p PointZMS) XYZM() PointZM

XYZM returns 3D+1D point

func (PointZMS) XYZMS Uses

func (p PointZMS) XYZMS() struct {
    Srid uint32
    Xyzm PointZM
}

XYZMS returns the struct itself

type PointZMSSetter Uses

type PointZMSSetter interface {
    PointZMSer
    SetXYZMS(srid uint32, xyzm PointZM) error
}

PointZMSSetter is a mutable PointZMer

type PointZMSer Uses

type PointZMSer interface {
    Geometry
    XYZMS() struct {
        Srid uint32
        Xyzm PointZM
    }
}

PointZMSer is a 3D+1D point + SRID

type PointZMSetter Uses

type PointZMSetter interface {
    PointZMer
    SetXYZM([4]float64) error
}

PointZMSetter is a mutable PointZMer

type PointZMer Uses

type PointZMer interface {
    Geometry
    XYZM() [4]float64
}

PointZMer is a 3D+1D point.

type PointZS Uses

type PointZS struct {
    Srid uint32
    Xyz  PointZ
}

Point describes a simple 3D point with SRID

func (PointZS) S Uses

func (p PointZS) S() uint32

S returns the srid as uint32

func (*PointZS) SetXYZS Uses

func (p *PointZS) SetXYZS(srid uint32, xyz PointZ) (err error)

SetXYZS sets the XYZ coordinates and the SRID

func (PointZS) XYZ Uses

func (p PointZS) XYZ() PointZ

XYZ returns 3D point

func (PointZS) XYZS Uses

func (p PointZS) XYZS() struct {
    Srid uint32
    Xyz  PointZ
}

XYZS returns the struct itself

type PointZSSetter Uses

type PointZSSetter interface {
    PointZSer
    SetXYZS(srid uint32, xyz PointZ) error
}

PointZSSetter is a mutable PointZSer

type PointZSer Uses

type PointZSer interface {
    Geometry
    XYZS() struct {
        Srid uint32
        Xyz  PointZ
    }
}

PointZSer is a 3D point + SRID

type PointZSetter Uses

type PointZSetter interface {
    PointZer
    SetXYZ([3]float64) error
}

PointZSetter is a mutable PointZer

type PointZer Uses

type PointZer interface {
    Geometry
    XYZ() [3]float64
}

PointZer is a 3D point.

type Pointer Uses

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

Pointer is a point with two dimensions.

type Polygon Uses

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 Uses

func (p Polygon) AsSegments() (segs [][]Line, err error)

AsSegments returns the polygon as a slice of lines. This will make no attempt to only add unique segments.

func (Polygon) LinearRings Uses

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

LinearRings returns the coordinates of the linear rings

func (*Polygon) SetLinearRings Uses

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

SetLinearRings modifies the array of 2D coordinates

type PolygonSetter Uses

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

PolygonSetter is a mutable Polygoner.

type Polygoner Uses

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.

type Triangle Uses

type Triangle [3][2]float64

Triangle is a array representation of a geometry triangle.

func NewTriangleContaining Uses

func NewTriangleContaining(pts ...Point) Triangle

NewTriangleContaining returns a triangle that is large enough to contain the given points

func NewTriangleContainingPoints Uses

func NewTriangleContainingPoints(pts ...[2]float64) Triangle

func NewTriangleForExtent Uses

func NewTriangleForExtent(ext *Extent, buff float64) (Triangle, error)

func NewTriangleFromPolygon Uses

func NewTriangleFromPolygon(py [][][2]float64) Triangle

NewTriangleFromPolygon takes the first three points from the outer ring of a polygon to create a triangle.

func (Triangle) Area Uses

func (t Triangle) Area() float64

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) Center Uses

func (t Triangle) Center() (pt [2]float64)

Center returns a point at the center of the triangle.

func (Triangle) LinearRings Uses

func (t Triangle) LinearRings() [][][2]float64

LinearRings returns the coordinates of the linear rings

func (Triangle) ThirdPoint Uses

func (t Triangle) ThirdPoint(p1, p2 [2]float64) [2]float64

ThirdPoint takes 2 points and checks which point is the 3rd in the Triangle

Directories

PathSynopsis
cmd
cmp
encoding
encoding/geojson
encoding/gpkg
encoding/gpkg/examples
encoding/mvtPackage mvt is used to encode MVT tiles
encoding/mvt/vector_tilego:generate protoc "--go_out=." "vector_tile.proto"
encoding/wkbPackage 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.
encoding/wkb/internal/consts
encoding/wkb/internal/decode
encoding/wkb/internal/encode
encoding/wkb/internal/tcase
encoding/wkb/internal/tcase/symbol
encoding/wkb/internal/tcase/token
encoding/wkt
internal/debuggerPackage debugger provides a way for us to capture partial geometries during geometry processing.
internal/debugger/recorder
internal/debugger/recorder/gpkg
internal/parsing
internal/rtreegoPackage rtreego is a library for efficiently storing and querying spatial data.
internal/test/must
planar
planar/clip
planar/coord
planar/coord/utmPackage utm provides the ability to work with UTM coordinates
planar/intersect
planar/makevalid
planar/makevalid/hitmap
planar/makevalid/walker
planar/simplify
planar/triangulate
planar/triangulate/delaunay
planar/triangulate/delaunay/quadedgePackage quadedge describes a quadedge object used to build up the triangulation A quadedge is made up of four directional edges
planar/triangulate/delaunay/subdivision
planar/triangulate/delaunay/subdivision/internal/phenix
planar/triangulate/delaunay/subdivision/pseudopolygon
planar/triangulate/delaunay/subdivision/testingtables
slippy
spherical
testingThis file contains geometries hand picked out of natural earth for as they serve for good edge cases
testing/mustPackage must provides helpers to decode wkt geometries to be used in tests
windingPackage winding provides primitives for determining the winding order of a set of points

Package geom imports 6 packages (graph) and is imported by 95 packages. Updated 2021-01-13. Refresh now. Tools for package owners.