Class: Envelope

jsts.geom.Envelope

new Envelope()

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

Members

(nullable) maxx :number

the maximum x-coordinate
Type:
  • number
Source:

(nullable) maxy :number

the maximum y-coordinate
Type:
  • number
Source:

(nullable) minx :number

the minimum x-coordinate
Type:
  • number
Source:

(nullable) miny :number

the minimum y-coordinate
Type:
  • number
Source:

Methods

(static) intersects(p1, p2, q) → {boolean}

Test the point q to see whether it intersects the Envelope defined by p1-p2 NOTE: calls intersectsEnvelope if four arguments are given to simulate overloaded function
Parameters:
Name Type Description
p1 jsts.geom.Coordinate one extremal point of the envelope.
p2 jsts.geom.Coordinate another extremal point of the envelope.
q jsts.geom.Coordinate the point to test for intersection.
Source:
Returns:
true if q intersects the envelope p1-p2.
Type
boolean

(static) intersectsEnvelope(p1, p2, q1, q2) → {boolean}

Test the envelope defined by p1-p2 for intersection with the envelope defined by q1-q2
Parameters:
Name Type Description
p1 jsts.geom.Coordinate one extremal point of the envelope P.
p2 jsts.geom.Coordinate another extremal point of the envelope P.
q1 jsts.geom.Coordinate one extremal point of the envelope Q.
q2 jsts.geom.Coordinate another extremal point of the envelope Q.
Source:
Returns:
true if Q intersects P.
Type
boolean

centre() → {jsts.geom.Coordinate}

Computes the coordinate of the centre of this envelope (as long as it is non-null
Source:
Returns:
the centre coordinate of this envelope null if the envelope is null.
Type
jsts.geom.Coordinate

clone() → {jsts.geom.Envelope}

Source:
Returns:
A new instance copied from this.
Type
jsts.geom.Envelope

contains() → {boolean}

Tests if the input lies wholely inside this Envelope (inclusive of the boundary). Will call appropriate contains* depending on arguments.
Source:
Returns:
true if input is contained in this Envelope.
Type
boolean

containsCoordinate(p) → {boolean}

Tests if the given point lies in or on the envelope.

Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

Parameters:
Name Type Description
p jsts.geom.Coordinate the point which this Envelope is being checked for containing.
Source:
See:
  • covers(Coordinate)
Returns:
true if the point lies in the interior or on the boundary of this Envelope.
Type
boolean

containsEnvelope(other) → {boolean}

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

Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

Parameters:
Name Type Description
other jsts.geom.Envelope the Envelope to check.
Source:
See:
  • covers(Envelope)
Returns:
true if other is contained in this Envelope.
Type
boolean

containsValues(x, y) → {boolean}

Tests if the given point lies in or on the envelope.

Note that this is not the same definition as the SFS contains, which would exclude the envelope boundary.

Parameters:
Name Type Description
x number the x-coordinate of the point which this Envelope is being checked for containing.
y number the y-coordinate of the point which this Envelope is being checked for containing.
Source:
See:
  • covers(double, double)
Returns:
true if (x, y) lies in the interior or on the boundary of this Envelope.
Type
boolean

covers()

Tests if the given point lies in or on the envelope. Will call appropriate contains* depending on arguments.
Source:

coversCoordinate(p) → {boolean}

Tests if the given point lies in or on the envelope.
Parameters:
Name Type Description
p jsts.geom.Coordinate the point which this Envelope is being checked for containing.
Source:
Returns:
true if the point lies in the interior or on the boundary of this Envelope.
Type
boolean

coversEnvelope(other) → {boolean}

Tests if the Envelope other lies wholely inside this Envelope (inclusive of the boundary).
Parameters:
Name Type Description
other jsts.geom.Envelope the Envelope to check.
Source:
Returns:
true if this Envelope covers the other.
Type
boolean

coversValues(x, y) → {boolean}

Tests if the given point lies in or on the envelope.
Parameters:
Name Type Description
x number the x-coordinate of the point which this Envelope is being checked for containing.
y number the y-coordinate of the point which this Envelope is being checked for containing.
Source:
Returns:
true if (x, y) lies in the interior or on the boundary of this Envelope.
Type
boolean

distance(env) → {number}

Computes the distance between this and another Envelope.
Parameters:
Name Type Description
env jsts.geom.Envelope The Envelope to test this Envelope against.
Source:
Returns:
The distance between overlapping Envelopes is 0. Otherwise, the distance is the Euclidean distance between the closest points.
Type
number

equals(other) → {boolean}

Parameters:
Name Type Description
other jsts.geom.Envelope the Envelope to check against.
Source:
Returns:
true if envelopes are equal.
Type
boolean

expandBy()

Enlarges this Envelope Will call appropriate expandBy* depending on arguments.
Source:

expandByDistance(distance)

Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.
Parameters:
Name Type Description
distance number the distance to expand the envelope.
Source:

expandByDistances(deltaX, deltaY)

Expands this envelope by a given distance in all directions. Both positive and negative distances are supported.
Parameters:
Name Type Description
deltaX number the distance to expand the envelope along the the X axis.
deltaY number the distance to expand the envelope along the the Y axis.
Source:

expandToInclude()

Enlarges this Envelope Will call appropriate expandToInclude* depending on arguments.
Source:

expandToIncludeCoordinate(p)

Enlarges this Envelope so that it contains the given Coordinate. Has no effect if the point is already on or within the envelope.
Parameters:
Name Type Description
p jsts.geom.Coordinate the Coordinate to expand to include.
Source:

expandToIncludeEnvelope(other)

Enlarges this Envelope so that it contains the other Envelope. Has no effect if other is wholly on or within the envelope.
Parameters:
Name Type Description
other jsts.geom.Envelope the Envelope to expand to include.
Source:

expandToIncludeValues(x, y)

Enlarges this Envelope so that it contains the given point. Has no effect if the point is already on or within the envelope.
Parameters:
Name Type Description
x number the value to lower the minimum x to or to raise the maximum x to.
y number the value to lower the minimum y to or to raise the maximum y to.
Source:

getArea() → {number}

Gets the area of this envelope.
Source:
Returns:
the area of the envelope, 0.0 if the envelope is null.
Type
number

getHeight() → {number}

Returns the difference between the maximum and minimum y values.
Source:
Returns:
max y - min y, or 0 if this is a null Envelope.
Type
number

getMaxX() → {number}

Returns the Envelopes maximum x-value. min x > max x indicates that this is a null Envelope.
Source:
Returns:
the maximum x-coordinate.
Type
number

getMaxY() → {number}

Returns the Envelopes maximum y-value. min y > max y indicates that this is a null Envelope.
Source:
Returns:
the maximum y-coordinate.
Type
number

getMinX() → {number}

Returns the Envelopes minimum x-value. min x > max x indicates that this is a null Envelope.
Source:
Returns:
the minimum x-coordinate.
Type
number

getMinY() → {number}

Returns the Envelopes minimum y-value. min y > max y indicates that this is a null Envelope.
Source:
Returns:
the minimum y-coordinate.
Type
number

getWidth() → {number}

Returns the difference between the maximum and minimum x values.
Source:
Returns:
max x - min x, or 0 if this is a null Envelope.
Type
number

init()

Creates an Envelope for a region defined by maximum and minimum values. Will call appropriate init* method depending on arguments.
Source:

initFromCoordinate(p)

Initialize an Envelope to a region defined by a single Coordinate.
Parameters:
Name Type Description
p jsts.geom.Coordinate the Coordinate.
Source:

initFromCoordinates(p1, p2)

Initialize an Envelope to a region defined by two Coordinates.
Parameters:
Name Type Description
p1 jsts.geom.Coordinate the first Coordinate.
p2 jsts.geom.Coordinate the second Coordinate.
Source:

initFromEnvelope(env)

Initialize an Envelope from an existing Envelope.
Parameters:
Name Type Description
env jsts.geom.Envelope the Envelope to initialize from.
Source:

initFromValues(x1, x2, y1, y2)

Initialize an Envelope for a region defined by maximum and minimum values.
Parameters:
Name Type Description
x1 number the first x-value.
x2 number the second x-value.
y1 number the first y-value.
y2 number the second y-value.
Source:

intersection(env) → {jsts.geom.Envelope}

Computes the intersection of two Envelopes
Parameters:
Name Type Description
env jsts.geom.Envelope the envelope to intersect with.
Source:
Returns:
a new Envelope representing the intersection of the envelopes (this will be the null envelope if either argument is null, or they do not intersect.
Type
jsts.geom.Envelope

intersects() → {boolean}

Check if the region defined by input overlaps (intersects) the region of this Envelope. Will call appropriate intersects* depending on arguments.
Source:
Returns:
true if an overlap is found.
Type
boolean

intersectsCoordinate(p) → {boolean}

Check if the point p overlaps (lies inside) the region of this Envelope.
Parameters:
Name Type Description
p jsts.geom.Coordinate the Coordinate to be tested.
Source:
Returns:
true if the point overlaps this Envelope.
Type
boolean

intersectsEnvelope(other) → {boolean}

Check if the region defined by other overlaps (intersects) the region of this Envelope.
Parameters:
Name Type Description
other jsts.geom.Envelope the Envelope which this Envelope is being checked for overlapping.
Source:
Returns:
true if the Envelopes overlap.
Type
boolean

intersectsValues(x, y) → {boolean}

Check if the point (x, y) overlaps (lies inside) the region of this Envelope.
Parameters:
Name Type Description
x number the x-ordinate of the point.
y number the y-ordinate of the point.
Source:
Returns:
true if the point overlaps this Envelope.
Type
boolean

isNull() → {boolean}

Returns true if this Envelope is a "null" envelope.
Source:
Returns:
true if this Envelope is uninitialized or is the envelope of the empty geometry.
Type
boolean

setToNull()

Makes this Envelope a "null" envelope, that is, the envelope of the empty geometry.
Source:

toString() → {string}

Source:
Returns:
String representation of this Envelope.
Type
string

translate(transX, transY)

Translates this envelope by given amounts in the X and Y direction.
Parameters:
Name Type Description
transX number the amount to translate along the X axis.
transY number the amount to translate along the Y axis.
Source: