Skip to main content

Envelope

The Envelope object is a C structure that contains the minimum and maximum X, Y coordinates for a rectangle bounding box. The naming of the variables is compatible with the OGR Envelope structure.

Attributes

AttributeTypeDescription
min_xfloatReturn the value of the minimum X coordinate.
min_yfloatReturn the value of the minimum Y coordinate.
max_xfloatReturn the value of the maximum X coordinate.
max_yfloatReturn the value of the maximum Y coordinate.
urtupleReturn the upper-right coordinate.
lltupleReturn the lower-left coordinate.
tupletupleReturn a tuple representing the envelope.
wktstringReturn WKT representing a Polygon for this envelope.

Constructor

Signature

def Envelope(
*args: Any
) - > null

Parameters

NameTypeDescription
*argsAnyVariable length argument list that can contain an OGREnvelope, a 4-item sequence, or 4 separate numeric values.

Methods


expand_to_include()

@classmethod
def expand_to_include(
*args: any
)

Modify the envelope to expand to include the boundaries of the passed-in 2-tuple (a point), 4-tuple (an extent) or envelope.

Parameters

NameTypeDescription
*argsanyA point (2-tuple), an extent (4-tuple), an Envelope object, or individual x/y coordinates to be merged into the current bounding box

min_x()

@classmethod
def min_x() - > float

Return the value of the minimum X coordinate.

Returns

TypeDescription
floatThe westernmost X coordinate of the bounding box

min_y()

@classmethod
def min_y() - > float

Return the value of the minimum Y coordinate.

Returns

TypeDescription
floatThe southernmost Y coordinate of the bounding box

max_x()

@classmethod
def max_x() - > float

Return the value of the maximum X coordinate.

Returns

TypeDescription
floatThe easternmost X coordinate of the bounding box

max_y()

@classmethod
def max_y() - > float

Return the value of the maximum Y coordinate.

Returns

TypeDescription
floatThe northernmost Y coordinate of the bounding box

ur()

@classmethod
def ur() - > tuple

Return the upper-right coordinate.

Returns

TypeDescription
tupleA 2-tuple containing the (max_x, max_y) coordinates

ll()

@classmethod
def ll() - > tuple

Return the lower-left coordinate.

Returns

TypeDescription
tupleA 2-tuple containing the (min_x, min_y) coordinates

tuple()

@classmethod
def tuple() - > tuple

Return a tuple representing the envelope.

Returns

TypeDescription
tupleA 4-tuple of the envelope boundaries in (min_x, min_y, max_x, max_y) order

wkt()

@classmethod
def wkt() - > string

Return WKT representing a Polygon for this envelope.

Returns

TypeDescription
stringA Well-Known Text string defining a closed rectangular POLYGON based on the envelope boundaries