Class: QgsMeasureUtils

Utilities for handling and formatting measurements.

Added in version 4.0.

List of all members, including inherited members

Static Methods

formatAreaForProject

Formats an area measurement (with the specified unit) for use with a project, respecting the project's area unit settings.

formatDistanceForProject

Formats a distance measurement (with the specified unit) for use with a project, respecting the project's distance unit settings.

class qgis.core.QgsMeasureUtils[source]

Bases: object

static formatAreaForProject(project: QgsProject | None, area: float, unit: Qgis.AreaUnit) str[source]

Formats an area measurement (with the specified unit) for use with a project, respecting the project’s area unit settings.

Parameters:
Return type:

str

static formatDistanceForProject(project: QgsProject | None, distance: float, unit: Qgis.DistanceUnit) str[source]

Formats a distance measurement (with the specified unit) for use with a project, respecting the project’s distance unit settings.

Parameters:
Return type:

str