Skip to content
  • BooleanField
  • class Esri::ArcGISRuntime::BooleanField

    Boolean values associated with each point across a two-dimensional (x, y) extent. More...

    Header: #include <BooleanField.h>
    Since: Esri::ArcGISRuntime 300.0
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    virtual ~BooleanField() override
    QFuture<QStringList> exportToFilesAsync(const QString &outputDirectory, const QString &filenamesPrefix)
    Esri::ArcGISRuntime::Envelope extent() const

    Static Public Members

    QFuture<Esri::ArcGISRuntime::BooleanField *> createFromFilesAsync(const QStringList &filePaths, int band, QObject *parent = nullptr)
    QFuture<Esri::ArcGISRuntime::BooleanField *> createFromFilesAsync(const QStringList &filePaths, int band, const Esri::ArcGISRuntime::SpatialReference &spatialReference, QObject *parent = nullptr)

    Detailed Description

    A boolean field identifies areas for which some condition is met and provides a means of identifying areas to be included in or excluded from analysis.

    Examples of boolean fields include:

    • Areas where the elevation is greater than or equal to 200m.
    • Cloud masks (areas obscured by clouds).
    • Areas where the land classification is "urban".
    • Areas where the probability that an observer has a direct line of sight is greater than 50%.

    See also ContinuousField, DiscreteField, BooleanFieldFunction, and BooleanFieldFunction::evaluateAsync.

    Member Function Documentation

    [override virtual noexcept] BooleanField::~BooleanField()

    Destructor.

    [static] QFuture<Esri::ArcGISRuntime::BooleanField *> BooleanField::createFromFilesAsync(const QStringList &filePaths, int band, QObject *parent = nullptr)

    Create a boolean field from one or more raster files.

    • filePaths - One or more raster file paths.
    • band - Zero-based index identifying a raster band.
    • parent - The optional parent.

    The field will be in the spatial reference of the first raster file.

    There will be an error if creation of a BooleanField is unsuccessful.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    See also exportToFilesAsync(const QString&, const QString&) and TransformationCatalog::transformationsBySuitability.

    [static] QFuture<Esri::ArcGISRuntime::BooleanField *> BooleanField::createFromFilesAsync(const QStringList &filePaths, int band, const Esri::ArcGISRuntime::SpatialReference &spatialReference, QObject *parent = nullptr)

    Creates a boolean field from one or more raster files.

    • filePaths - One or more raster file paths.
    • band - Zero-based index identifying a raster band.
    • spatialReference - The spatial reference into which to project the raster content.
    • parent - The optional parent.

    If a spatial reference is not given, the spatial reference of the first raster file is used.

    If a spatial reference is given, the raster content is projected into that spatial reference using the most suitable transformation available. Projection transforms only the horizontal coordinate system, not the field values.

    Supports reading of all raster pixel types except float (32-bit or 64-bit). Boolean values are derived as true when the source value is non-zero. Returns an error if creation of a BooleanField is unsuccessful.

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    See also exportToFilesAsync(const QString&, const QString&) and TransformationCatalog::transformationsBySuitability.

    QFuture<QStringList> BooleanField::exportToFilesAsync(const QString &outputDirectory, const QString &filenamesPrefix)

    Export the BooleanField to files in geoTIFF format.

    • outputDirectory - The location of the exported files.
    • filenamesPrefix - The filename prefix of the exported files.

    This enables a BooleanField to be saved, persisted, and shared.

    Regardless of the original data format:

    • A BooleanField is always exported as 2-bit unsigned integer data
    • A value of 2 is used to represent NoData in the exported files

    Small spatial fields are saved as a single file named outputDirectory/filenamesPrefix.tiff. Large spatial fields will be saved as multiple files using the following naming convention: outputDirectory/filenamesPrefix_0.tiff, outputDirectory/filenamesPrefix_1.tiff, ..., outputDirectory/filenamesPrefix_N.tiff. Whether a field is saved as multiple files depends on the amount of information contained by the field and the memory resources available on the host device. The .tiff extension is automatically appended to each file name.

    The output directory is expected to exist and have appropriate write permissions. There should be no existing files at the export location.

    To read a BooleanField from files created by this method, use createFromFilesAsync(const QStringList&, int, const Esri::ArcGISRuntime::SpatialReference&, QObject*) with the paths returned from this method and a band identifier of 0.

    An error is returned if file export is unsuccessful

    This method returns a QFuture for the asynchronous operation. Use future.then() to continue processing when the operation completes. Use future.onFailed() to handle exceptions of type ErrorException.

    See Working with QFuture for further details.

    See also createFromFilesAsync(const QStringList&, int, const Esri::ArcGISRuntime::SpatialReference&, QObject*).

    Esri::ArcGISRuntime::Envelope BooleanField::extent() const

    Returns the geographic extent of the boolean field.

    An extent may be empty, indicating that there is no data across the two-dimensional space. This may occur when performing operations on two spatial fields that do not intersect.

    See also Geometry::isEmpty.

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