Class: QgsGeographicCoordinateNumericFormat

class qgis.core.QgsGeographicCoordinateNumericFormat

Bases: QgsBasicNumericFormat

A numeric formatter which returns a text representation of a geographic coordinate (latitude or longitude).

New in version 3.26.

QgsGeographicCoordinateNumericFormat() Default constructor

QgsGeographicCoordinateNumericFormat(QgsGeographicCoordinateNumericFormat)

Enums

AngleFormat

Bases: enum.IntEnum

Methods

angleFormat

Returns the angle format, which controls how bearing the angles are formatted described in the returned strings.

clone

rtype

QgsGeographicCoordinateNumericFormat

configuration

param context

create

param configuration

formatDouble

param value

id

rtype

str

setAngleFormat

Sets the directional formatting option, which controls how bearing the angles are formatted described in the returned strings.

setConfiguration

param configuration

setShowDegreeLeadingZeros

Sets whether leading zeros for the degree values should be shown.

setShowDirectionalSuffix

Sets whether directional suffixes (e.g.

setShowLeadingZeros

Sets whether leading zeros in the minutes or seconds values should be shown.

showDegreeLeadingZeros

Returns True if leading zeros for the degree values should be shown.

showDirectionalSuffix

Returns True if directional suffixes (e.g.

showLeadingZeros

Returns True if leading zeros in the minutes or seconds values should be shown.

sortKey

rtype

int

suggestSampleValue

rtype

float

visibleName

rtype

str

Attributes

staticMetaObject

class AngleFormat(value)

Bases: enum.IntEnum

Angle format options.

  • DegreesMinutesSeconds: Degrees, minutes and seconds, eg 30 degrees 45’30

  • DegreesMinutes: Degrees and decimal minutes, eg 30 degrees 45.55’

  • DecimalDegrees: Decimal degrees, eg 30.7555 degrees

DecimalDegrees = 2
DegreesMinutes = 1
DegreesMinutesSeconds = 0
baseClass

alias of QgsGeographicCoordinateNumericFormat

angleFormat(self) QgsGeographicCoordinateNumericFormat.AngleFormat

Returns the angle format, which controls how bearing the angles are formatted described in the returned strings.

See also

setAngleFormat()

Return type

QgsGeographicCoordinateNumericFormat.AngleFormat

clone(self) QgsGeographicCoordinateNumericFormat
Return type

QgsGeographicCoordinateNumericFormat

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

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

str

id(self) str
Return type

str

setAngleFormat(self, format: QgsGeographicCoordinateNumericFormat.AngleFormat)

Sets the directional formatting option, which controls how bearing the angles are formatted described in the returned strings.

See also

angleFormat()

Parameters

format (QgsGeographicCoordinateNumericFormat.AngleFormat) –

setConfiguration(self, configuration: Dict[str, Any], context: QgsReadWriteContext)
Parameters
setShowDegreeLeadingZeros(self, show: bool)

Sets whether leading zeros for the degree values should be shown.

Parameters

show (bool) –

setShowDirectionalSuffix(self, show: bool)

Sets whether directional suffixes (e.g. “N”) should be included.

Parameters

show (bool) –

setShowLeadingZeros(self, show: bool)

Sets whether leading zeros in the minutes or seconds values should be shown.

Parameters

show (bool) –

showDegreeLeadingZeros(self) bool

Returns True if leading zeros for the degree values should be shown.

Return type

bool

showDirectionalSuffix(self) bool

Returns True if directional suffixes (e.g. “N”) should be included.

Return type

bool

showLeadingZeros(self) bool

Returns True if leading zeros in the minutes or seconds values should be shown.

Return type

bool

sortKey(self) int
Return type

int

staticMetaObject = <PyQt5.QtCore.QMetaObject object>
suggestSampleValue(self) float
Return type

float

visibleName(self) str
Return type

str