Unit Class

  • Unit
  • class Esri::ArcGISRuntime::Unit

    Base class for classes that represent a unit of measurement. More...

    Header: #include <Unit.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherited By:

    Esri::ArcGISRuntime::AngularUnit, Esri::ArcGISRuntime::AreaUnit, and Esri::ArcGISRuntime::LinearUnit

    Public Functions

    Unit()
    Unit(const Esri::ArcGISRuntime::Unit &other)
    Unit(Esri::ArcGISRuntime::Unit &&other)
    virtual ~Unit()
    QString abbreviation() const
    QString displayName() const
    bool isEmpty() const
    QString name() const
    QString pluralDisplayName() const
    Esri::ArcGISRuntime::UnitType unitType() const
    int wkid() const
    Esri::ArcGISRuntime::Unit &operator=(const Esri::ArcGISRuntime::Unit &other)
    Esri::ArcGISRuntime::Unit &operator=(Esri::ArcGISRuntime::Unit &&other)

    Static Public Members

    Esri::ArcGISRuntime::Unit fromWkid(int wkid)

    Detailed Description

    Unit is a base class for measurement classes such as LinearUnit, AngularUnit, and AreaUnit. Many function parameters only accept specific types of measurement to reduce the chance of accidental use of inappropriate values, but some generic functions accept all unit types, such as for translation from ID to text description.

    LinearUnit - Projected coordinate systems define coordinates using linear measurements, for example using meters or miles. They are also used to return distance measurements, for example by some members of GeometryEngine.

    AngularUnit - Geographic coordinate systems define coordinates using angular measurements, for example using degrees or radians.

    AreaUnit - Projected coordinate systems define area units for two dimensional measurements such as the area enclosed by a ring, for example in acres or square kilometers.

    Linear, angular, and area units can be defined by using enumerations of the most common units of measurement. They can also be defined by well-known identifier (wkid) or well-known text (wkText). Create the unit instances using the Unit base class or the subtype, passing in the enumeration for a specific unit of measurement.

    Each instance has properties for the unit name (singular, plural and abbreviated) and provides methods for unit conversion between different units of measurement in the same category of measurement. All unit names and abbreviations are returned in the English language.

    Create Unit instances using the subtypes, passing in the enumeration for a specific unit of measurement. Custom unit implementations are not supported.

    Instances of Unit are immutable.

    Member Function Documentation

    Unit::Unit()

    Default constructor.

    Unit::Unit(const Esri::ArcGISRuntime::Unit &other)

    Copy constructor from other Unit.

    Unit::Unit(Esri::ArcGISRuntime::Unit &&other)

    Move constructor from other Unit.

    [virtual] Unit::~Unit()

    Destructor

    QString Unit::abbreviation() const

    Gets the abbreviated unit name.

    QString Unit::displayName() const

    Gets the singular display name (for example, FOOT).

    [static, since Esri::ArcGISRuntime 100.14] Esri::ArcGISRuntime::Unit Unit::fromWkid(int wkid)

    Returns a unit given its well-known ID.

    • wkid - The well-known ID of the unit.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    bool Unit::isEmpty() const

    Gets whether this Unit is empty.

    A default constructed Unit is empty.

    Returns true if empty.

    QString Unit::name() const

    Gets the unit name.

    QString Unit::pluralDisplayName() const

    Gets the plural display name (for example, FEET).

    Esri::ArcGISRuntime::UnitType Unit::unitType() const

    Gets the unit type.

    [since Esri::ArcGISRuntime 100.14] int Unit::wkid() const

    Gets the well-known ID for the unit, or 0 for a custom unit.

    This function was introduced in Esri::ArcGISRuntime 100.14.

    Esri::ArcGISRuntime::Unit &Unit::operator=(const Esri::ArcGISRuntime::Unit &other)

    Assignment operator from other Unit.

    Esri::ArcGISRuntime::Unit &Unit::operator=(Esri::ArcGISRuntime::Unit &&other)

    Move operator from other Unit.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.