Class: QgsRangedoubleBase

A template based class for storing ranges (lower to upper values).

QgsRange classes represent a range of values of some element type. For instance, ranges of int might be used to represent integer ranges.

Ranges can indicate whether the upper and lower values are inclusive or exclusive. The inclusivity or exclusivity of bounds is considered when determining things like whether ranges overlap or during calculation of range intersections.

See also

QgsDoubleRange

See also

QgsIntRange

Note

not available in Python bindings (but class provided for template-based inheritance)

Class Hierarchy

Inheritance diagram of qgis.core.QgsRangedoubleBase

Subclasses

QgsDoubleRange

QgsRange which stores a range of double values.

Methods

contains

Returns True if this range contains another range.

includeLower

Returns True if the lower bound is inclusive, or False if the lower bound is exclusive.

includeUpper

Returns True if the upper bound is inclusive, or False if the upper bound is exclusive.

isEmpty

Returns True if the range is empty, ie the lower bound equals (or exceeds) the upper bound and either the bounds are exclusive.

isSingleton

Returns True if the range consists only of a single value or instant.

lower

Returns the lower bound of the range.

overlaps

Returns True if this range overlaps another range.

rangeLimits

Returns the limit handling of the range.

upper

Returns the upper bound of the range.

class qgis.core.QgsRangedoubleBase

Bases: object

__init__(lower: float, upper: float, includeLower: bool = True, includeUpper: bool = True)

Constructor for QgsRange. The lower and upper bounds are specified, and optionally whether or not these bounds are included in the range.

Parameters:
  • lower (float)

  • upper (float)

  • includeLower (bool = True)

  • includeUpper (bool = True)

__init__(lower: float, upper: float, limits: Qgis.RangeLimits)

Constructor for QgsRange. The lower and upper bounds are specified, and whether or not these bounds are included in the range.

Added in version 3.38.

Parameters:
__init__(a0: QgsRangedoubleBase)
Parameters:

a0 (QgsRangedoubleBase)

contains(self, other: QgsRangedoubleBase) bool

Returns True if this range contains another range.

See also

overlaps()

Parameters:

other (QgsRangedoubleBase)

Return type:

bool

contains(self, element: float) bool

Returns True if this range contains a specified element.

Parameters:

element (float)

Return type:

bool

includeLower(self) bool

Returns True if the lower bound is inclusive, or False if the lower bound is exclusive.

See also

lower()

See also

includeUpper()

Return type:

bool

includeUpper(self) bool

Returns True if the upper bound is inclusive, or False if the upper bound is exclusive.

See also

upper()

See also

includeLower()

Return type:

bool

isEmpty(self) bool

Returns True if the range is empty, ie the lower bound equals (or exceeds) the upper bound and either the bounds are exclusive.

See also

isSingleton()

Return type:

bool

isSingleton(self) bool

Returns True if the range consists only of a single value or instant.

See also

isEmpty()

Return type:

bool

lower(self) float

Returns the lower bound of the range.

See also

upper()

See also

includeLower()

Return type:

float

overlaps(self, other: QgsRangedoubleBase) bool

Returns True if this range overlaps another range.

See also

contains()

Parameters:

other (QgsRangedoubleBase)

Return type:

bool

rangeLimits(self) Qgis.RangeLimits

Returns the limit handling of the range.

Added in version 3.38.

Return type:

Qgis.RangeLimits

upper(self) float

Returns the upper bound of the range.

See also

lower()

See also

includeUpper()

Return type:

float