Documentation
¶
Overview ¶
Package matrix Define spatial matrix base.
Package matrix Define spatial matrix base.
Package matrix Define spatial matrix base.
Package matrix Define spatial matrix base.
Package matrix Define spatial matrix base.
Index ¶
- type Bound
- type Collection
- func (c Collection) Bound() Bound
- func (c Collection) Boundary() (Steric, error)
- func (c Collection) BoundaryDimensions() int
- func (c Collection) Dimensions() int
- func (c Collection) Equals(ms Steric) bool
- func (c Collection) EqualsExact(ms Steric, tolerance float64) bool
- func (c Collection) Filter(f Filter) Steric
- func (c Collection) IsEmpty() bool
- func (c Collection) Nums() int
- func (c Collection) Proximity(ms Steric) bool
- type Filter
- type IntersectionMatrix
- func (im *IntersectionMatrix) IsContains() bool
- func (im *IntersectionMatrix) IsCoveredBy() bool
- func (im *IntersectionMatrix) IsCovers() bool
- func (im *IntersectionMatrix) IsCrosses(dimensionOfGeometryA, dimensionOfGeometryB int) bool
- func (im *IntersectionMatrix) IsDisjoint() bool
- func (im *IntersectionMatrix) IsEquals(dimensionOfGeometryA, dimensionOfGeometryB int) bool
- func (im *IntersectionMatrix) IsIntersects() bool
- func (im *IntersectionMatrix) IsOverlaps(dimensionOfGeometryA, dimensionOfGeometryB int) bool
- func (im *IntersectionMatrix) IsTouches(dimensionOfGeometryA, dimensionOfGeometryB int) bool
- func (im *IntersectionMatrix) IsWithin() bool
- func (im *IntersectionMatrix) Matches(pattern string) (bool, error)
- func (im *IntersectionMatrix) Set(row, column, dimensionValue int)
- func (im *IntersectionMatrix) SetAll(dimensionValue int)
- func (im *IntersectionMatrix) SetAtLeast(row, column, minimumDimensionValue int)
- func (im *IntersectionMatrix) SetAtLeastIfValid(row, column, minimumDimensionValue int)
- func (im *IntersectionMatrix) SetAtLeastString(minimumDimensionSymbols string)
- func (im *IntersectionMatrix) SetString(dimensionSymbols string)
- func (im *IntersectionMatrix) ToString() string
- func (im *IntersectionMatrix) Transpose() *IntersectionMatrix
- type LineMatrix
- func (l LineMatrix) Bound() Bound
- func (l LineMatrix) Boundary() (Steric, error)
- func (l LineMatrix) BoundaryDimensions() int
- func (l LineMatrix) Dimensions() int
- func (l LineMatrix) Equals(ms Steric) bool
- func (l LineMatrix) EqualsExact(ms Steric, tolerance float64) bool
- func (l LineMatrix) Filter(f Filter) Steric
- func (l LineMatrix) IsClosed() bool
- func (l LineMatrix) IsEmpty() bool
- func (l LineMatrix) Nums() int
- func (l LineMatrix) Proximity(ms Steric) bool
- func (l LineMatrix) Reverse() LineMatrix
- func (l LineMatrix) ToLineArray() (lines []*LineSegment)
- type LineSegment
- type Matrix
- func (m Matrix) Bound() Bound
- func (m Matrix) Boundary() (Steric, error)
- func (m Matrix) BoundaryDimensions() int
- func (m Matrix) Compare(m1 Matrix) (int, error)
- func (m Matrix) Dimensions() int
- func (m Matrix) Equals(ms Steric) bool
- func (m Matrix) EqualsExact(ms Steric, tolerance float64) bool
- func (m Matrix) Filter(f Filter) Steric
- func (m Matrix) IsEmpty() bool
- func (m Matrix) Nums() int
- func (m Matrix) Proximity(ms Steric) bool
- type MultiPolygonMatrix
- func (m MultiPolygonMatrix) Bound() Bound
- func (m MultiPolygonMatrix) Boundary() (Steric, error)
- func (m MultiPolygonMatrix) BoundaryDimensions() int
- func (m MultiPolygonMatrix) Dimensions() int
- func (m MultiPolygonMatrix) Equals(ms Steric) bool
- func (m MultiPolygonMatrix) EqualsExact(ms Steric, tolerance float64) bool
- func (m MultiPolygonMatrix) Filter(f Filter) Steric
- func (m MultiPolygonMatrix) IsEmpty() bool
- func (m MultiPolygonMatrix) Nums() int
- func (m MultiPolygonMatrix) Proximity(ms Steric) bool
- type PolygonMatrix
- func (p PolygonMatrix) Bound() Bound
- func (p PolygonMatrix) Boundary() (Steric, error)
- func (p PolygonMatrix) BoundaryDimensions() int
- func (p PolygonMatrix) Dimensions() int
- func (p PolygonMatrix) Equals(ms Steric) bool
- func (p PolygonMatrix) EqualsExact(ms Steric, tolerance float64) bool
- func (p PolygonMatrix) Filter(f Filter) Steric
- func (p PolygonMatrix) IsEmpty() bool
- func (p PolygonMatrix) IsRectangle() bool
- func (p PolygonMatrix) Nums() int
- func (p PolygonMatrix) Proximity(ms Steric) bool
- type Steric
- type UniqueArrayFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bound ¶ added in v1.1.0
type Bound []Matrix
A Bound represents a closed box or rectangle. To create a bound with two points you can do something like: MultiPoint{p1, p2}.Bound()
func (Bound) Contains ¶ added in v1.1.0
Contains determines if the point is within the bound. Points on the boundary are considered within.
func (Bound) ContainsBound ¶ added in v1.1.0
ContainsBound determines if the bound is within the bound.
func (Bound) Equals ¶ added in v1.1.0
Equals checks if the Bound represents the same Geometry or vector.
func (Bound) IntersectsBound ¶ added in v1.1.0
IntersectsBound Tests if the region defined by other intersects the region of this Envelope.
func (Bound) IsEmpty ¶ added in v1.1.0
IsEmpty returns true if it contains zero area or if it's in some malformed negative state where the left point is larger than the right. This can be caused by padding too much negative.
func (Bound) ToPolygon ¶ added in v1.1.0
func (b Bound) ToPolygon() PolygonMatrix
ToPolygon converts the bound into a Polygon object.
func (Bound) ToRing ¶ added in v1.1.0
func (b Bound) ToRing() LineMatrix
ToRing converts the bound into a loop defined by the boundary of the box.
type Collection ¶
type Collection []Steric
A Collection is a collection of sterices that is also a Steric.
func CollectionFromMultiLineMatrix ¶ added in v1.1.1
func CollectionFromMultiLineMatrix(ml []LineMatrix) Collection
func (Collection) Bound ¶
func (c Collection) Bound() Bound
Bound returns a bound around the Collection.
func (Collection) Boundary ¶ added in v1.1.0
func (c Collection) Boundary() (Steric, error)
Boundary returns the closure of the combinatorial boundary of this Collection.
func (Collection) BoundaryDimensions ¶
func (c Collection) BoundaryDimensions() int
BoundaryDimensions Compute the IM entry for the intersection of the boundary of a geometry with the Exterior.
func (Collection) Dimensions ¶
func (c Collection) Dimensions() int
Dimensions returns the max of the dimensions of the collection.
func (Collection) Equals ¶
func (c Collection) Equals(ms Steric) bool
Equals returns true if the two Collection are equal
func (Collection) EqualsExact ¶
func (c Collection) EqualsExact(ms Steric, tolerance float64) bool
EqualsExact returns true if the two Collection are equalexact
func (Collection) Filter ¶ added in v1.0.2
func (c Collection) Filter(f Filter) Steric
Filter Performs an operation with the provided .
func (Collection) IsEmpty ¶
func (c Collection) IsEmpty() bool
IsEmpty returns true if the Matrix is empty.
func (Collection) Proximity ¶ added in v1.1.0
func (c Collection) Proximity(ms Steric) bool
Proximity returns true if the Steric represents the Proximity Geometry or vector.
type Filter ¶ added in v1.0.2
type Filter interface { // IsChanged Returns the true when need change. IsChanged() bool // FilterMatrixes Performs an operation with the provided . FilterMatrixes(matrixes []Matrix) // Filter Performs an operation with the provided . Filter(matrix Matrix) // Matrixes Returns matrixes. Matrixes() []Matrix // Clear clear matrixes. Clear() }
Filter An interface which use the values of the matrix in a Steric.
matrix filters can be used to implement centroid and envelope computation, and many other functions.
type IntersectionMatrix ¶
type IntersectionMatrix struct {
// contains filtered or unexported fields
}
IntersectionMatrix a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. DE-9IM matrix values (such as "212FF1FF2") specify the topological relationship between two Geometries. DE-9IM matrices are 3x3 matrices with integer entries. The matrix indices {0,1,2} represent the topological locations that occur in a geometry (Interior, Boundary, Exterior). For a description of the DE-9IM and the spatial predicates derived from it, see the following references: <a href="http://www.opengis.org/techno/specs.htm"> OGC 99-049 OpenGIS Simple Features Specification for SQL</a> <a href="http://portal.opengeospatial.org/files/?artifact_id=25355"> OGC 06-103r4 OpenGIS Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture</a>
func IntersectionMatrixDefault ¶
func IntersectionMatrixDefault() *IntersectionMatrix
IntersectionMatrixDefault Creates an IntersectionMatrix with FALSE dimension values.
func (*IntersectionMatrix) IsContains ¶
func (im *IntersectionMatrix) IsContains() bool
IsContains Tests whether this matrix matches [T*****FF*[.
func (*IntersectionMatrix) IsCoveredBy ¶
func (im *IntersectionMatrix) IsCoveredBy() bool
IsCoveredBy Tests if this matrix matches
[T*F**F***]
or [*TF**F***] or [**FT*F***] or [**F*TF***]
func (*IntersectionMatrix) IsCovers ¶
func (im *IntersectionMatrix) IsCovers() bool
IsCovers Tests if this matrix matches
[T*****FF*]
or [*T****FF*] or [***T**FF*] or [****T*FF*]
func (*IntersectionMatrix) IsCrosses ¶
func (im *IntersectionMatrix) IsCrosses(dimensionOfGeometryA, dimensionOfGeometryB int) bool
IsCrosses Tests whether this geometry crosses the specified geometry.
func (*IntersectionMatrix) IsDisjoint ¶
func (im *IntersectionMatrix) IsDisjoint() bool
IsDisjoint Tests if this matrix matches [FF*FF****].
func (*IntersectionMatrix) IsEquals ¶
func (im *IntersectionMatrix) IsEquals(dimensionOfGeometryA, dimensionOfGeometryB int) bool
IsEquals Tests whether the argument dimensions are equal and this matrix matches the pattern <tt>[T*F**FFF*]</tt>.
func (*IntersectionMatrix) IsIntersects ¶
func (im *IntersectionMatrix) IsIntersects() bool
IsIntersects Tests if isDisjoint returns false.
func (*IntersectionMatrix) IsOverlaps ¶
func (im *IntersectionMatrix) IsOverlaps(dimensionOfGeometryA, dimensionOfGeometryB int) bool
IsOverlaps Tests if this matrix matches
[T*T***T**](for two points or two surfaces) [1*T***T**] (for two curves)
func (*IntersectionMatrix) IsTouches ¶
func (im *IntersectionMatrix) IsTouches(dimensionOfGeometryA, dimensionOfGeometryB int) bool
IsTouches Tests if this matrix matches [FT*******], [F**T*****] or [F***T****].
func (*IntersectionMatrix) IsWithin ¶
func (im *IntersectionMatrix) IsWithin() bool
IsWithin Tests whether this matrix matches [T*F**F***].
func (*IntersectionMatrix) Matches ¶
func (im *IntersectionMatrix) Matches(pattern string) (bool, error)
Matches Tests whether this matrix matches the given matrix pattern.
func (*IntersectionMatrix) Set ¶
func (im *IntersectionMatrix) Set(row, column, dimensionValue int)
Set Changes the value of one of this IntersectionMatrixes elements.
func (*IntersectionMatrix) SetAll ¶
func (im *IntersectionMatrix) SetAll(dimensionValue int)
SetAll Changes the elements of this IntersectionMatrix to dimensionValue
func (*IntersectionMatrix) SetAtLeast ¶
func (im *IntersectionMatrix) SetAtLeast(row, column, minimumDimensionValue int)
SetAtLeast Changes the specified element to minimumDimensionValue if the element is less.
func (*IntersectionMatrix) SetAtLeastIfValid ¶
func (im *IntersectionMatrix) SetAtLeastIfValid(row, column, minimumDimensionValue int)
SetAtLeastIfValid If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue if the element is less. Does nothing if row <0 or column < 0.
func (*IntersectionMatrix) SetAtLeastString ¶
func (im *IntersectionMatrix) SetAtLeastString(minimumDimensionSymbols string)
SetAtLeastString For each element in this IntersectionMatrix, changes the
element to the corresponding minimum dimension symbol if the element is less.
func (*IntersectionMatrix) SetString ¶
func (im *IntersectionMatrix) SetString(dimensionSymbols string)
SetString Changes the elements of this IntersectionMatrix to the dimension symbols in dimensionSymbols.
func (*IntersectionMatrix) ToString ¶
func (im *IntersectionMatrix) ToString() string
ToString Returns a nine-character String representation of this IntersectionMatrix
func (*IntersectionMatrix) Transpose ¶
func (im *IntersectionMatrix) Transpose() *IntersectionMatrix
Transpose this IntersectionMatrix.
type LineMatrix ¶
type LineMatrix [][]float64
LineMatrix is a two-dimensional matrix.
func (LineMatrix) Bound ¶
func (l LineMatrix) Bound() Bound
Bound returns a rect around the line string. Uses rectangular coordinates.
func (LineMatrix) Boundary ¶ added in v1.1.0
func (l LineMatrix) Boundary() (Steric, error)
Boundary returns the closure of the combinatorial boundary of this LineMatrix. The boundary of a lineal geometry is always a zero-dimensional geometry (which may be empty).
func (LineMatrix) BoundaryDimensions ¶
func (l LineMatrix) BoundaryDimensions() int
BoundaryDimensions Compute the IM entry for the intersection of the boundary of a geometry with the Exterior.
func (LineMatrix) Dimensions ¶
func (l LineMatrix) Dimensions() int
Dimensions returns 0 because a line matrix is a 0d object.
func (LineMatrix) Equals ¶
func (l LineMatrix) Equals(ms Steric) bool
Equals returns true if the two LineMatrix are equal
func (LineMatrix) EqualsExact ¶
func (l LineMatrix) EqualsExact(ms Steric, tolerance float64) bool
EqualsExact returns true if the two Matrix are equalexact
func (LineMatrix) Filter ¶ added in v1.0.2
func (l LineMatrix) Filter(f Filter) Steric
Filter Performs an operation with the provided .
func (LineMatrix) IsClosed ¶
func (l LineMatrix) IsClosed() bool
IsClosed Returns TRUE if the line's start and end points are coincident. For Polyhedral Surfaces, reports if the surface is areal (open) or IsC (closed).
func (LineMatrix) IsEmpty ¶
func (l LineMatrix) IsEmpty() bool
IsEmpty returns true if the Matrix is empty.
func (LineMatrix) Proximity ¶ added in v1.1.0
func (l LineMatrix) Proximity(ms Steric) bool
Proximity returns true if the Steric represents the Proximity Geometry or vector.
func (LineMatrix) Reverse ¶ added in v1.1.0
func (l LineMatrix) Reverse() LineMatrix
Reverse this LineMatrix.
func (LineMatrix) ToLineArray ¶
func (l LineMatrix) ToLineArray() (lines []*LineSegment)
ToLineArray returns the LineArray
type LineSegment ¶
type LineSegment struct {
P0, P1 Matrix
}
LineSegment is line.
func LineArray ¶
func LineArray(l LineMatrix) (lines []*LineSegment)
LineArray returns the LineArray
func (*LineSegment) PointAlong ¶
func (l *LineSegment) PointAlong(segmentLengthFraction float64) Matrix
PointAlong Computes point that lies a given fraction along the line defined by this segment. A fraction of 0.0 returns the start point of the segment; a fraction of 1.0 returns the end point of the segment. If the fraction is < 0.0 or > 1.0 the point returned will lie before the start or beyond the end of the segment.
func (*LineSegment) PointAlongOffset ¶
func (l *LineSegment) PointAlongOffset(segmentLengthFraction, offsetDistance float64) (Matrix, error)
PointAlongOffset Computes point that lies a given fraction along the line defined by this segment and offset from the segment by a given distance. A fraction of 0.0 offsets from the start point of the segment; a fraction of 1.0 offsets from the end point of the segment. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative.
type Matrix ¶
type Matrix []float64
Matrix is a one-dimensional matrix.
func TransMatrixes ¶
TransMatrixes trans steric to array matrixes.
func (Matrix) Boundary ¶ added in v1.1.0
Boundary returns the closure of the combinatorial boundary of this Matrix.
func (Matrix) BoundaryDimensions ¶
BoundaryDimensions Compute the IM entry for the intersection of the boundary of a geometry with the Exterior.
func (Matrix) Compare ¶
Compare returns 0 if m1==m2,1 if positive ,-1 else Compares Coordinate for order.
func (Matrix) Dimensions ¶
Dimensions returns 0 because a matrix is a 0d object.
func (Matrix) EqualsExact ¶
EqualsExact returns true if the two Matrix are equalexact
type MultiPolygonMatrix ¶
type MultiPolygonMatrix [][][][]float64
MultiPolygonMatrix is a four-dimensional matrix.
func (MultiPolygonMatrix) Bound ¶
func (m MultiPolygonMatrix) Bound() Bound
Bound returns a bound around the multi-polygon.
func (MultiPolygonMatrix) Boundary ¶ added in v1.1.0
func (m MultiPolygonMatrix) Boundary() (Steric, error)
Boundary returns the closure of the combinatorial boundary of this Polygon.
func (MultiPolygonMatrix) BoundaryDimensions ¶
func (m MultiPolygonMatrix) BoundaryDimensions() int
BoundaryDimensions Compute the IM entry for the intersection of the boundary of a geometry with the Exterior.
func (MultiPolygonMatrix) Dimensions ¶
func (m MultiPolygonMatrix) Dimensions() int
Dimensions returns 3 because a 3 Dimensions matrix is a multi 2D object.
func (MultiPolygonMatrix) Equals ¶
func (m MultiPolygonMatrix) Equals(ms Steric) bool
Equals returns true if the two MultiPolygonMatrix are equal
func (MultiPolygonMatrix) EqualsExact ¶
func (m MultiPolygonMatrix) EqualsExact(ms Steric, tolerance float64) bool
EqualsExact returns true if the two Matrix are equalexact
func (MultiPolygonMatrix) Filter ¶ added in v1.0.2
func (m MultiPolygonMatrix) Filter(f Filter) Steric
Filter Performs an operation with the provided .
func (MultiPolygonMatrix) IsEmpty ¶
func (m MultiPolygonMatrix) IsEmpty() bool
IsEmpty returns true if the Matrix is empty.
func (MultiPolygonMatrix) Proximity ¶ added in v1.1.0
func (m MultiPolygonMatrix) Proximity(ms Steric) bool
Proximity returns true if the Steric represents the Proximity Geometry or vector.
type PolygonMatrix ¶
type PolygonMatrix [][][]float64
PolygonMatrix is a three-dimensional matrix.
func (PolygonMatrix) Bound ¶
func (p PolygonMatrix) Bound() Bound
Bound returns a bound around the polygon.
func (PolygonMatrix) Boundary ¶ added in v1.1.0
func (p PolygonMatrix) Boundary() (Steric, error)
Boundary returns the closure of the combinatorial boundary of this Polygon.
func (PolygonMatrix) BoundaryDimensions ¶
func (p PolygonMatrix) BoundaryDimensions() int
BoundaryDimensions Compute the IM entry for the intersection of the boundary of a geometry with the Exterior.
func (PolygonMatrix) Dimensions ¶
func (p PolygonMatrix) Dimensions() int
Dimensions returns 2 because a polygon matrix is a 2d object.
func (PolygonMatrix) Equals ¶
func (p PolygonMatrix) Equals(ms Steric) bool
Equals returns true if the two PolygonMatrix are equal
func (PolygonMatrix) EqualsExact ¶
func (p PolygonMatrix) EqualsExact(ms Steric, tolerance float64) bool
EqualsExact returns true if the two Matrix are equalexact
func (PolygonMatrix) Filter ¶ added in v1.0.2
func (p PolygonMatrix) Filter(f Filter) Steric
Filter Performs an operation with the provided .
func (PolygonMatrix) IsEmpty ¶
func (p PolygonMatrix) IsEmpty() bool
IsEmpty returns true if the Matrix is empty.
func (PolygonMatrix) IsRectangle ¶ added in v1.1.0
func (p PolygonMatrix) IsRectangle() bool
IsRectangle returns true if the polygon is rectangle.
func (PolygonMatrix) Proximity ¶ added in v1.1.0
func (p PolygonMatrix) Proximity(ms Steric) bool
Proximity returns true if the Steric represents the Proximity Geometry or vector.
type Steric ¶
type Steric interface { // e.g. 0d, 1d, 2d Dimensions() int BoundaryDimensions() int // Boundary returns the closure of the combinatorial boundary of this Steric. // The boundary of a lineal geometry is always a zero-dimensional geometry (which may be empty). Boundary() (Steric, error) // Num of geometries Nums() int // Equals returns true if the Steric represents the same Geometry or vector. Equals(s Steric) bool // Proximity returns true if the Steric represents the Proximity Geometry or vector. Proximity(s Steric) bool // EqualsExact Returns true if the two Steric are exactly equal, // up to a specified distance tolerance. // Two Steric are exactly equal within a distance tolerance EqualsExact(g Steric, tolerance float64) bool // IsEmpty returns true if the Matrix is empty. IsEmpty() bool Bound() Bound // Filter Performs an operation with the provided . Filter(f Filter) Steric }
Steric is the interface implemented by other Steric objects
type UniqueArrayFilter ¶ added in v1.0.2
type UniqueArrayFilter struct { IsNotChange bool // contains filtered or unexported fields }
UniqueArrayFilter A Filter that extracts a unique array.
func (*UniqueArrayFilter) Clear ¶ added in v1.0.2
func (u *UniqueArrayFilter) Clear()
Clear Returns the gathered Matrixes.
func (*UniqueArrayFilter) Filter ¶ added in v1.0.2
func (u *UniqueArrayFilter) Filter(matrix Matrix)
Filter Performs an operation with the provided .
func (*UniqueArrayFilter) FilterMatrixes ¶ added in v1.0.2
func (u *UniqueArrayFilter) FilterMatrixes(matrixes []Matrix)
FilterMatrixes Performs an operation with the provided .
func (*UniqueArrayFilter) IsChanged ¶ added in v1.0.2
func (u *UniqueArrayFilter) IsChanged() bool
IsChanged Returns the true when need change.
func (*UniqueArrayFilter) Matrixes ¶ added in v1.0.2
func (u *UniqueArrayFilter) Matrixes() []Matrix
Matrixes Returns the gathered Matrixes.