Class: QgsBearingNumericFormat

class qgis.core.QgsBearingNumericFormat

Bases: QgsBasicNumericFormat

A numeric formatter which returns a text representation of a direction/bearing.

New in version 3.12.

QgsBearingNumericFormat() Default constructor

QgsBearingNumericFormat(QgsBearingNumericFormat)

Methods

clone

rtype

QgsBearingNumericFormat

configuration

param context

create

param configuration

directionFormat

Returns the directional formatting option, which controls how bearing direction is described in the returned strings.

formatDouble

param value

id

rtype

str

setConfiguration

param configuration

setDirectionFormat

Sets the directional formatting option, which controls how bearing direction is described in the returned strings.

sortKey

rtype

int

suggestSampleValue

rtype

float

visibleName

rtype

str

Attributes

UseRange0To180WithEWDirectionalSuffix

UseRange0To360

UseRangeNegative180ToPositive180

class FormatDirectionOption

Bases: int

UseRange0To180WithEWDirectionalSuffix = 0
UseRange0To360 = 2
UseRangeNegative180ToPositive180 = 1
clone(self) QgsBearingNumericFormat
Return type

QgsBearingNumericFormat

configuration(self, context: QgsReadWriteContext) Dict[str, Any]
Parameters

context (QgsReadWriteContext) –

Return type

Dict[str, Any]

create(self, configuration: Dict[str, Any], context: QgsReadWriteContext) QgsNumericFormat
Parameters
Return type

QgsNumericFormat

directionFormat(self) QgsBearingNumericFormat.FormatDirectionOption

Returns the directional formatting option, which controls how bearing direction is described in the returned strings.

Return type

QgsBearingNumericFormat.FormatDirectionOption

formatDouble(self, value: float, context: QgsNumericFormatContext) str
Parameters
Return type

str

id(self) str
Return type

str

setConfiguration(self, configuration: Dict[str, Any], context: QgsReadWriteContext)
Parameters
setDirectionFormat(self, format: QgsBearingNumericFormat.FormatDirectionOption)

Sets the directional formatting option, which controls how bearing direction is described in the returned strings.

Parameters

format (QgsBearingNumericFormat.FormatDirectionOption) –

sortKey(self) int
Return type

int

suggestSampleValue(self) float
Return type

float

visibleName(self) str
Return type

str