matrix

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 5 Imported by: 0

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

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

func (b Bound) Contains(m Matrix) bool

Contains determines if the point is within the bound. Points on the boundary are considered within.

func (Bound) ContainsBound added in v1.1.0

func (b Bound) ContainsBound(bound Bound) bool

ContainsBound determines if the bound is within the bound.

func (Bound) Equals added in v1.1.0

func (b Bound) Equals(g Bound) bool

Equals checks if the Bound represents the same Geometry or vector.

func (Bound) IntersectsBound added in v1.1.0

func (b Bound) IntersectsBound(other Bound) bool

IntersectsBound Tests if the region defined by other intersects the region of this Envelope.

func (Bound) IsEmpty added in v1.1.0

func (b Bound) IsEmpty() bool

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) Nums

func (c Collection) Nums() int

Nums ...

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) Nums

func (l LineMatrix) Nums() int

Nums num of line matrix

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 &lt; 0.0 or &gt; 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

func TransMatrixes(inputGeom Steric) []Matrix

TransMatrixes trans steric to array matrixes.

func (Matrix) Bound

func (m Matrix) Bound() Bound

Bound returns a single point bound of the point.

func (Matrix) Boundary added in v1.1.0

func (m Matrix) Boundary() (Steric, error)

Boundary returns the closure of the combinatorial boundary of this Matrix.

func (Matrix) BoundaryDimensions

func (m Matrix) BoundaryDimensions() int

BoundaryDimensions Compute the IM entry for the intersection of the boundary of a geometry with the Exterior.

func (Matrix) Compare

func (m Matrix) Compare(m1 Matrix) (int, error)

Compare returns 0 if m1==m2,1 if positive ,-1 else Compares Coordinate for order.

func (Matrix) Dimensions

func (m Matrix) Dimensions() int

Dimensions returns 0 because a matrix is a 0d object.

func (Matrix) Equals

func (m Matrix) Equals(ms Steric) bool

Equals returns true if the two Matrix are equal

func (Matrix) EqualsExact

func (m Matrix) EqualsExact(ms Steric, tolerance float64) bool

EqualsExact returns true if the two Matrix are equalexact

func (Matrix) Filter added in v1.0.2

func (m Matrix) Filter(f Filter) Steric

Filter Performs an operation with the provided .

func (Matrix) IsEmpty

func (m Matrix) IsEmpty() bool

IsEmpty returns true if the Matrix is empty.

func (Matrix) Nums

func (m Matrix) Nums() int

Nums num of matrix

func (Matrix) Proximity added in v1.1.0

func (m Matrix) Proximity(ms Steric) bool

Proximity returns true if the Steric represents the Proximity Geometry or vector.

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) Nums

func (m MultiPolygonMatrix) Nums() int

Nums num of polygon matrix

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) Nums

func (p PolygonMatrix) Nums() int

Nums num of polygon matrix

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.

Directories

Path Synopsis
Package envelope Defines a rectangular region of the 2D coordinate plane.
Package envelope Defines a rectangular region of the 2D coordinate plane.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL