Class: QgsRendererRange

class qgis.core.QgsRendererRange

Bases: sip.wrapper

Constructor for QgsRendererRange.

QgsRendererRange(range: QgsClassificationRange, symbol: QgsSymbol, render: bool = True) Creates a renderer symbol range

Parameters:
  • range – The classification range

  • symbol – The symbol for this renderer range

  • render – If True, it will be renderered

QgsRendererRange(lowerValue: float, upperValue: float, symbol: QgsSymbol, label: str, render: bool = True)

QgsRendererRange(range: QgsRendererRange)

Methods

dump

Dumps a string representation of the range.

label

Returns the label used for the range.

lowerValue

Returns the lower bound of the range.

renderState

Returns True if the range should be rendered.

setLabel

Sets the label used for the range.

setLowerValue

Sets the lower bound of the range.

setRenderState

Sets whether the range should be rendered.

setSymbol

Sets the symbol used for the range.

setUpperValue

Sets the upper bound of the range.

swap

param other:

symbol

Returns the symbol used for the range.

toSld

Creates a DOM element representing the range in SLD format.

upperValue

Returns the upper bound of the range.

dump(self) str

Dumps a string representation of the range.

Return type:

str

label(self) str

Returns the label used for the range.

See also

setLabel()

Return type:

str

lowerValue(self) float

Returns the lower bound of the range.

See also

setLowerValue()

See also

upperValue()

Return type:

float

renderState(self) bool

Returns True if the range should be rendered.

See also

setRenderState()

New in version 2.6.

Return type:

bool

setLabel(self, label: str)

Sets the label used for the range.

See also

label()

Parameters:

label (str) –

setLowerValue(self, lowerValue: float)

Sets the lower bound of the range.

See also

lowerValue()

See also

setUpperValue()

Parameters:

lowerValue (float) –

setRenderState(self, render: bool)

Sets whether the range should be rendered.

See also

renderState()

New in version 2.6.

Parameters:

render (bool) –

setSymbol(self, s: QgsSymbol)

Sets the symbol used for the range.

Ownership of the symbol is transferred.

See also

symbol()

Parameters:

s (QgsSymbol) –

setUpperValue(self, upperValue: float)

Sets the upper bound of the range.

See also

upperValue()

See also

setLowerValue()

Parameters:

upperValue (float) –

swap(self, other: QgsRendererRange)
Parameters:

other (QgsRendererRange) –

symbol(self) QgsSymbol

Returns the symbol used for the range.

See also

setSymbol()

Return type:

QgsSymbol

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any], firstRange: bool = False)

Creates a DOM element representing the range in SLD format.

Parameters:
  • doc (QDomDocument) – DOM document

  • element (QDomElement) – destination DOM element

  • props (Dict[str) – graduated renderer properties

  • firstRange (bool = False) – set to True if the range is the first range, where the lower value uses a <= test rather than a < test.

upperValue(self) float

Returns the upper bound of the range.

See also

setUpperValue()

See also

lowerValue()

Return type:

float