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.
Index ¶
- type Collection
- func (c Collection) Bound() []Matrix
- 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
- 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() []Matrix
- 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) ToLineArray() (lines []*LineSegment)
- type LineSegment
- type Matrix
- func (m Matrix) Bound() []Matrix
- 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
- type MultiPolygonMatrix
- func (m MultiPolygonMatrix) Bound() []Matrix
- 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
- type PolygonMatrix
- func (p PolygonMatrix) Bound() []Matrix
- 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) Nums() int
- type Steric
- type UniqueArrayFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection []Steric
A Collection is a collection of sterices that is also a Steric.
func (Collection) Bound ¶
func (c Collection) Bound() []Matrix
Bound returns a bound around the 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.
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 ... Matrixes() []Matrix // Clear ... 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 <UL>
<LI><tt>[T*T***T**]</tt> (for two points or two surfaces) <LI><tt>[1*T***T**]</tt> (for two curves)
</UL>.
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() []Matrix
Bound returns a rect around the line string. Uses rectangular coordinates.
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 LINESTRING'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) 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) 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() []Matrix
Bound returns a bound around the multi-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 0 because a 3 Dimensions matrix is a 0d 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.
type PolygonMatrix ¶
type PolygonMatrix [][][]float64
PolygonMatrix is a three-dimensional matrix.
func (PolygonMatrix) Bound ¶
func (p PolygonMatrix) Bound() []Matrix
Bound returns a bound around the 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 0 because a polygon matrix is a 0d 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.
type Steric ¶
type Steric interface { // e.g. 0d, 1d, 2d Dimensions() int BoundaryDimensions() int // Num of geometries Nums() int // Equals returns true if the Geometry represents the same Geometry or vector. Equals(s Steric) bool // EqualsExact Returns true if the two Geometries are exactly equal, // up to a specified distance tolerance. // Two Geometries are exactly equal within a distance tolerance EqualsExact(g Steric, tolerance float64) bool // IsEmpty returns true if the Matrix is empty. IsEmpty() bool Bound() []Matrix // 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.