envelope

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: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsIntersects

func IsIntersects(p1, p2, q matrix.Matrix) bool

IsIntersects Test the point q to see whether it intersects the Envelope defined by p1-p2

func IsIntersectsTwo

func IsIntersectsTwo(p1, p2, q1, q2 matrix.Matrix) bool

IsIntersectsTwo Tests whether the envelope defined by p1-p2 and the envelope defined by q1-q2 intersect.

Types

type Envelope

type Envelope struct {
	MaxX, MinX, MaxY, MinY float64
}

Envelope Defines a rectangular region of the 2D coordinate plane.

It is often used to represent the bounding box of a  Geometry,
Envelopes support infinite or half-infinite regions, by using the values of
Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY.
Envelope objects may have a null value.
When Envelope objects are created or initialized,
the supplies extent values are automatically sorted into the correct order.

func Bound

func Bound(b []matrix.Matrix) *Envelope

Bound Creates an Envelope for a region defined by a single matrix.

func Empty

func Empty() *Envelope

Empty Creates a null Envelope.

func Env

func Env(env *Envelope) *Envelope

Env Create an Envelope from an existing Envelope.

func FourFloat

func FourFloat(x1, x2, y1, y2 float64) *Envelope

FourFloat Creates an Envelope for a region defined by maximum and minimum values.

func Matrix

func Matrix(p matrix.Matrix) *Envelope

Matrix Creates an Envelope for a region defined by a single matrix.

func MatrixList added in v1.0.4

func MatrixList(ps []matrix.Matrix) *Envelope

MatrixList Creates an Envelope from a matrix list

func PolygonMatrixList added in v1.0.4

func PolygonMatrixList(ps []matrix.PolygonMatrix) *Envelope

PolygonMatrixList Creates an Envelope from a polygon matrix list

func TwoMatrix

func TwoMatrix(p1, p2 matrix.Matrix) *Envelope

TwoMatrix Creates an Envelope for a region defined by two matrix.

func (*Envelope) Area

func (e *Envelope) Area() float64

Area Gets the area of this envelope.

func (*Envelope) Centre

func (e *Envelope) Centre() matrix.Matrix

Centre Computes the coordinate of the centre of this envelope (as long as it is non-null

func (*Envelope) CompareTo

func (e *Envelope) CompareTo(other *Envelope) int

CompareTo Compares two envelopes using lexicographic ordering.

func (*Envelope) Contains

func (e *Envelope) Contains(other *Envelope) bool

Contains Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).

func (*Envelope) Copy

func (e *Envelope) Copy() *Envelope

Copy Creates a copy of this envelope object.

func (*Envelope) Covers

func (e *Envelope) Covers(other *Envelope) bool

Covers Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).

func (*Envelope) Diameter

func (e *Envelope) Diameter() float64

Diameter Gets the length of the diameter (diagonal) of the envelopArea.

func (*Envelope) Disjoint

func (e *Envelope) Disjoint(other *Envelope) bool

Disjoint Tests if the region defined by other is disjoint from the region of this Envelope.

func (*Envelope) Distance

func (e *Envelope) Distance(env *Envelope) float64

Distance Computes the distance between this and another Envelope.

func (*Envelope) Equals

func (e *Envelope) Equals(other *Envelope) bool

Equals ...

func (*Envelope) ExpandBy

func (e *Envelope) ExpandBy(distance float64)

ExpandBy Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.

func (*Envelope) ExpandByXY

func (e *Envelope) ExpandByXY(deltaX, deltaY float64)

ExpandByXY Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.

func (*Envelope) ExpandToInclude

func (e *Envelope) ExpandToInclude(x, y float64)

ExpandToInclude Enlarges this Envelope so that it contains the given point. Has no effect if the point is already on or within the envelope.

func (*Envelope) ExpandToIncludeEnv

func (e *Envelope) ExpandToIncludeEnv(other *Envelope)

ExpandToIncludeEnv Enlarges this Envelope so that it contains the other Envelope.

Has no effect if other is wholly on or within the envelope.

func (*Envelope) ExpandToIncludeMatrix

func (e *Envelope) ExpandToIncludeMatrix(p matrix.Matrix)

ExpandToIncludeMatrix Enlarges this Envelope so that it contains

func (*Envelope) HashCode

func (e *Envelope) HashCode() int

HashCode Computes a hash code for a double value, using the algorithm from Joshua Bloch's book

func (*Envelope) Height

func (e *Envelope) Height() float64

Height Returns the difference between the maximum and minimum y values.

func (*Envelope) Intersection

func (e *Envelope) Intersection(env *Envelope) *Envelope

Intersection Computes the intersection of two Envelopes.

func (*Envelope) IsIntersects

func (e *Envelope) IsIntersects(other *Envelope) bool

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

func (*Envelope) IsNil

func (e *Envelope) IsNil() bool

IsNil Returns true if this Envelope is a "nil" envelope.

func (*Envelope) MaxExtent

func (e *Envelope) MaxExtent() float64

MaxExtent Gets the maximum extent of this envelope across both dimensions.

func (*Envelope) MinExtent

func (e *Envelope) MinExtent() float64

MinExtent Gets the minimum extent of this envelope across both dimensions.

func (*Envelope) Overlaps

func (e *Envelope) Overlaps(other *Envelope) bool

Overlaps overlaps may be changed to be a true overlap check; that is, whether the intersection is two-dimensional.

func (*Envelope) Proximity added in v1.1.3

func (e *Envelope) Proximity(other *Envelope) bool

Proximity ...

func (*Envelope) SetToNil

func (e *Envelope) SetToNil()

SetToNil Makes this Envelope a "null" envelope, that is, the envelope

of the empty geometry.

func (*Envelope) ToMatrix added in v1.0.4

func (e *Envelope) ToMatrix() *matrix.PolygonMatrix

ToMatrix ...

func (*Envelope) ToString

func (e *Envelope) ToString() string

ToString ...

func (*Envelope) Translate

func (e *Envelope) Translate(transX, transY float64)

Translate Translates this envelope by given amounts in the X and Y direction.

func (*Envelope) Width

func (e *Envelope) Width() float64

Width Returns the difference between the maximum and minimum x values.

Jump to

Keyboard shortcuts

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