GeoprocessingLinearUnit Class

  • GeoprocessingLinearUnit
  • class Esri::ArcGISRuntime::GeoprocessingLinearUnit

    A linear unit input or output parameter. More...

    Header: #include <GeoprocessingLinearUnit.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::GeoprocessingParameter

    Public Functions

    GeoprocessingLinearUnit(QObject *parent = nullptr)
    GeoprocessingLinearUnit(double distance, QObject *parent = nullptr)
    GeoprocessingLinearUnit(double distance, Esri::ArcGISRuntime::GeoprocessingLinearUnits geoprocessingUnit, QObject *parent = nullptr)
    GeoprocessingLinearUnit(double distance, const Esri::ArcGISRuntime::LinearUnit &unit, QObject *parent = nullptr)
    GeoprocessingLinearUnit(double distance, Esri::ArcGISRuntime::LinearUnitId unitId, QObject *parent = nullptr)
    virtual ~GeoprocessingLinearUnit() override
    double distance() const
    Esri::ArcGISRuntime::LinearUnit linearUnit() const
    void setDistance(double distance)
    void setUnit(Esri::ArcGISRuntime::GeoprocessingLinearUnits unit)
    Esri::ArcGISRuntime::GeoprocessingLinearUnits unit() const

    Detailed Description

    Corresponds to GPLinearUnit parameter type on the service.

    Geoprocessing tasks support a set of linear units defined in the GeoprocessingLinearUnits.

    When a GeoprocessingLinearUnit parameter is created with one of the supported GeoprocessingLinearUnits the value is sent to the service using defined linear unit type.

    When a GeoprocessingLinearUnit parameter is created with a LinearUnit, the value is converted to meters if the type is not supported. For example if provided LinearUnit is international miles, the value is converted to meters since only the US Survey Miles unit is supported in geoprocessing. After GeoprocessingLinearUnit is created, the used linear unit type can be checked from linearUnit.

    When GeoprocessingLinearUnit is created with a supported LinearUnit, then no conversion takes place and the value is sent to the service using the defined type.

    When GeoprocessingLinearUnit is returned as an output parameter, you can get LinearUnit using linearUnit method.

    {GeoprocessingLinearUnit(double, const Esri::ArcGISRuntime::LinearUnit&, QObject*)}

    See also GeoprocessingLinearUnit and Esri::ArcGISRuntime::GeoprocessingLinearUnit::GeoprocessingLinearUnit(double, const Esri::ArcGISRuntime::LinearUnit&, QObject*).

    Member Function Documentation

    [explicit] GeoprocessingLinearUnit::GeoprocessingLinearUnit(QObject *parent = nullptr)

    Create a geoprocessing linear unit parameter.

    • parent - The optional parent QObject.

    [explicit] GeoprocessingLinearUnit::GeoprocessingLinearUnit(double distance, QObject *parent = nullptr)

    Create a geoprocessing linear unit parameter with the given distance. The unit is assumed to be meters.

    • distance - The distance value of the parameter.
    • parent - The optional parent QObject.

    Note that although this constructor defaults to meters, the unit can be changed by calling unit. If the unit is changed in this way, the value is not converted.

    GeoprocessingLinearUnit::GeoprocessingLinearUnit(double distance, Esri::ArcGISRuntime::GeoprocessingLinearUnits geoprocessingUnit, QObject *parent = nullptr)

    Create a geoprocessing linear unit parameter with the given distance and linear unit.

    • distance - The distance value of the parameter.
    • geoprocessingUnit - The unit of distance.
    • parent - The optional parent QObject.

    The GeoprocessingLinearUnits used here represents the subset of linear units supported by geoprocessing.

    GeoprocessingLinearUnit::GeoprocessingLinearUnit(double distance, const Esri::ArcGISRuntime::LinearUnit &unit, QObject *parent = nullptr)

    Create a geoprocessing linear unit parameter with the given distance and linear unit.

    • distance - The distance value of the parameter.
    • unit - The unit of distance.
    • parent - The optional parent QObject.

    Note that if the given linear unit does not correspond to any of the values in GeoprocessingLinearUnits, the unit will be converted internally to meters. This means that the distance property will return a different value to that set.

    GeoprocessingLinearUnit::GeoprocessingLinearUnit(double distance, Esri::ArcGISRuntime::LinearUnitId unitId, QObject *parent = nullptr)

    Create a geoprocessing linear unit parameter with the given distance and linear unit WKID.

    • distance - The distance value of the parameter.
    • unitId - The WKID of the unit of distance.
    • parent - The optional parent QObject.

    Note that if the given linear unit WKID does not correspond to any of the values in GeoprocessingLinearUnits, the unit will be converted internally to meters. This means that the distance property will return a different value to that set.

    [override virtual] GeoprocessingLinearUnit::~GeoprocessingLinearUnit()

    Destructor.

    double GeoprocessingLinearUnit::distance() const

    Returns the distance value of this parameter.

    Note that if this geoprocessing linear unit instance was created with a unit type unsupported by geoprocessing, this value will differ from that set as it will have been converted to meters.

    See also setDistance().

    Esri::ArcGISRuntime::LinearUnit GeoprocessingLinearUnit::linearUnit() const

    Returns the geometry linear unit that corresponds to the unit of this parameter.

    This method gives a convenient means of using a geoprocessing linear unit with the geometry API. The returned LinearUnit can be used to convert the distance value of this parameter instance to any other linear unit supported by the geometry API.

    void GeoprocessingLinearUnit::setDistance(double distance)

    Sets the distance to distance.

    See also distance.

    void GeoprocessingLinearUnit::setUnit(Esri::ArcGISRuntime::GeoprocessingLinearUnits unit)

    Sets the unit to unit.

    See also unit.

    Esri::ArcGISRuntime::GeoprocessingLinearUnits GeoprocessingLinearUnit::unit() const

    Returns the geoprocessing unit of this parameter

    See also setUnit().

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