Class: QgsGeographicCoordinateNumericFormat

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

Added in version 3.26.

Class Hierarchy

Inheritance diagram of qgis.core.QgsGeographicCoordinateNumericFormat

Base classes

QgsBasicNumericFormat

A numeric formatter which returns a simple text representation of a value.

QgsNumericFormat

Abstract base class for numeric formatters, which allow for formatting a numeric value for display.

class qgis.core.QgsGeographicCoordinateNumericFormat[source]

Bases: QgsBasicNumericFormat

__init__()

Default constructor

__init__(a0: QgsGeographicCoordinateNumericFormat)
Parameters:

a0 (QgsGeographicCoordinateNumericFormat)

class AngleFormat(*values)

Bases: 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
angleFormat(self) QgsGeographicCoordinateNumericFormat.AngleFormat[source]

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

See also

setAngleFormat()

Return type:

QgsGeographicCoordinateNumericFormat.AngleFormat

setAngleFormat(self, format: QgsGeographicCoordinateNumericFormat.AngleFormat)[source]

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)

setShowDegreeLeadingZeros(self, show: bool)[source]

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

Parameters:

show (bool)

setShowDirectionalSuffix(self, show: bool)[source]

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

Parameters:

show (bool)

setShowLeadingZeros(self, show: bool)[source]

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

Parameters:

show (bool)

showDegreeLeadingZeros(self) bool[source]

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

Return type:

bool

showDirectionalSuffix(self) bool[source]

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

Return type:

bool

showLeadingZeros(self) bool[source]

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

Return type:

bool