A layer that can visualize raster data (from a raster data source). More...
Header: | #include <RasterLayer.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::ImageAdjustmentLayer, Esri::ArcGISRuntime::PopupSource, and Esri::ArcGISRuntime::TimeAware |
Public Functions
RasterLayer(Esri::ArcGISRuntime::Raster *raster, QObject *parent = nullptr) | |
RasterLayer(Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr) | |
virtual | ~RasterLayer() override |
Esri::ArcGISRuntime::Raster * | raster() const |
Esri::ArcGISRuntime::RasterRenderer * | renderer() const |
void | setRenderer(Esri::ArcGISRuntime::RasterRenderer *renderer) |
Reimplemented Public Functions
virtual Esri::ArcGISRuntime::TimeExtent | fullTimeExtent() const override |
virtual bool | isPopupEnabled() const override |
virtual bool | isSupportsTimeFiltering() const override |
virtual bool | isTimeFilteringEnabled() const override |
virtual Esri::ArcGISRuntime::PopupDefinition * | popupDefinition() const override |
virtual void | setPopupDefinition(Esri::ArcGISRuntime::PopupDefinition *popupDefinition) override |
virtual void | setPopupEnabled(bool popupEnabled) override |
virtual void | setTimeFilteringEnabled(bool timeFilteringEnabled) override |
virtual void | setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset) override |
virtual Esri::ArcGISRuntime::TimeValue | timeInterval() const override |
virtual Esri::ArcGISRuntime::TimeValue | timeOffset() const override |
Signals
void | fullTimeExtentChanged() |
Detailed Description
In its simplest form, raster data consists of a matrix of cells (or pixels) organized into rows and columns (or a grid) where each cell contains a value representing information.
Raster layer can support these main types of raster data sources:
- Raster files - path to a file on the device
- Remote ArcGIS Image services, see ImageServiceRaster
- Raster files within GeoPackages, see GeoPackageRaster
- Mosaic datasets, see MosaicDatasetRaster
You can change how a raster layer is visualized by creating a RasterRenderer and applying it to the layer. Each raster layer supports identify on its individual cells when it is displayed in a MapView or SceneView. The raster layer adopts the loadable pattern; many of its properties are initialized asynchronously. See Loadable for more information.
If a raster dataset has just one value associated with each cell it is called a single-band raster. For example, in a digital elevation model (DEM) each cell contains one value representing the elevation at that location.
A satellite image, however, commonly has multiple bands representing different wavelengths of the electromagnetic spectrum. Landsat imagery, for example, contains seven bands that represent data from the visible and infrared parts of the spectrum. Rasters are particularly useful for remote sensing tasks, such as monitoring vegetation and seeing through smoke to analyze an active fire.
Raster datasets can be quite large. The size of the dataset depends on the following:
- The geographic extent of the data
- The size of the cells used (resolution)
- The number of bands
As with any data consumed locally, file size can be an issue for storage as well as for transferring datasets over the network.
Learn more about rasters from the ArcGIS Desktop documentation.
Relevant samples:
- Apply mosaic rule to rasters: Apply mosaic rule to a mosaic dataset of rasters.
- Blend raster layer: Blend a hillshade with a raster by specifying the elevation data. The resulting raster looks similar to the original raster, but with some terrain shading, giving it a textured look.
- Colormap renderer: Apply a colormap renderer to a raster.
- Hillshade renderer: Apply a hillshade renderer to a raster.
- Identify raster cell: Get the cell value of a local raster at the tapped location and display the result in a callout.
- Raster function (file): Apply a raster function to a local raster file and display the output with a raster layer.
- Raster function (service): Load a raster from a service, then apply a function to it.
- Raster layer (file): Create and use a raster layer made from a local raster file.
- Raster layer (GeoPackage): Display a raster contained in a GeoPackage.
- Raster layer (service): Create a raster layer from a raster image service.
- Raster rendering rule: Display a raster on a map and apply different rendering rules to that raster.
- Read a GeoPackage: Add rasters and feature tables from a GeoPackage to a map.
- RGB renderer: Apply an RGB renderer to a raster layer to enhance feature visibility.
- Stretch renderer: Use a stretch renderer to enhance the visual contrast of raster data for analysis.
See also Layer, ImageAdjustmentLayer, Raster, ImageServiceRaster, GeoPackageRaster, MosaicDatasetRaster, https://developers.arcgis.com/qt/cpp/sample-code/raster-layer-geopackage/, https://developers.arcgis.com/qt/cpp/sample-code/raster-layer-file/, https://developers.arcgis.com/qt/cpp/sample-code/raster-hillshade-renderer/, https://developers.arcgis.com/qt/cpp/sample-code/raster-layer-service/, and https://developers.arcgis.com/qt/cpp/sample-code/apply-raster-function-to-raster-from-service/.
Member Function Documentation
[explicit]
RasterLayer::RasterLayer (Esri::ArcGISRuntime::Raster *raster, QObject *parent = nullptr)
Creates a raster layer from the specified raster data source.
- raster - Raster data source.
- parent - The optional parent QObject.
[explicit]
RasterLayer::RasterLayer (Esri::ArcGISRuntime::Item *item, QObject *parent = nullptr)
Creates a raster layer from the specified image service portal item.
- item - A portal item of type PortalItemType::ImageService.
- parent - The optional parent QObject.
See also Layer::item.
[override virtual]
RasterLayer::~RasterLayer ()
Destructor.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeExtent RasterLayer::fullTimeExtent () const
Reimplements: TimeAware::fullTimeExtent() const.
Returns the full time extent of the layer.
If the layer, such as an ArcGISMapImageLayer, has sublayers with different time extents, fullTimeExtent is a union of its sublayer's time extents.
This function was introduced in Esri::ArcGISRuntime 100.3.
[signal]
void RasterLayer::fullTimeExtentChanged ()
Signal emitted when the fullTimeExtent changes.
See also TimeAware.
[override virtual]
bool RasterLayer::isPopupEnabled () const
Reimplements: PopupSource::isPopupEnabled() const.
Returns a flag indicating whether the PopupDefinition defined on the PopupSource is enable / disable.
[override virtual, since Esri::ArcGISRuntime 100.3]
bool RasterLayer::isSupportsTimeFiltering () const
Reimplements: TimeAware::isSupportsTimeFiltering() const.
Returns true
if the layer supports filtering data based on its time values, false
otherwise.
This function was introduced in Esri::ArcGISRuntime 100.3.
[override virtual, since Esri::ArcGISRuntime 100.3]
bool RasterLayer::isTimeFilteringEnabled () const
Reimplements: TimeAware::isTimeFilteringEnabled() const.
Returns true
if the layer filters data based on its GeoView::timeExtent, false
otherwise.
This is only applicable if the layer's isSupportsTimeFiltering value is true
. If the GeoView::timeExtent value is empty, no time filtering is applied and all content is rendered.
This function was introduced in Esri::ArcGISRuntime 100.3.
[override virtual]
Esri::ArcGISRuntime::PopupDefinition *RasterLayer::popupDefinition () const
Reimplements: PopupSource::popupDefinition() const.
Returns the pop-up definition.
The PopupDefinition associated with the popup source. A nullptr
if an error occurs or if the popup source is not associated with a pop-up definition.
See PopupSource.
See also setPopupDefinition().
Esri::ArcGISRuntime::Raster *RasterLayer::raster() const
Returns the raster data source for this layer.
Esri::ArcGISRuntime::RasterRenderer *RasterLayer::renderer() const
Returns the raster renderer used for this layer.
See also setRenderer().
[override virtual]
void RasterLayer::setPopupDefinition (Esri::ArcGISRuntime::PopupDefinition *popupDefinition )
Reimplements: PopupSource::setPopupDefinition(Esri::ArcGISRuntime::PopupDefinition *popupDefinition).
Sets the popupDefinition to popupDefinition.
See also popupDefinition.
[override virtual]
void RasterLayer::setPopupEnabled (bool popupEnabled )
Reimplements: PopupSource::setPopupEnabled(bool popupEnabled).
Sets the popupEnabled to popupEnabled.
See also isPopupEnabled.
void RasterLayer::setRenderer (Esri::ArcGISRuntime::RasterRenderer *renderer)
Sets the renderer to renderer.
See also renderer.
[override virtual, since Esri::ArcGISRuntime 100.3]
void RasterLayer::setTimeFilteringEnabled (bool timeFilteringEnabled )
Reimplements: TimeAware::setTimeFilteringEnabled(bool timeFilteringEnabled).
Sets the timeFilteringEnabled to timeFilteringEnabled.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also isTimeFilteringEnabled.
[override virtual, since Esri::ArcGISRuntime 100.3]
void RasterLayer::setTimeOffset (const Esri::ArcGISRuntime::TimeValue &timeOffset )
Reimplements: TimeAware::setTimeOffset(const Esri::ArcGISRuntime::TimeValue &timeOffset).
Sets the timeOffset to timeOffset.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also timeOffset.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeValue RasterLayer::timeInterval () const
Reimplements: TimeAware::timeInterval() const.
Returns the suggested time slider step size for this time aware layer.
You can use this information to set the step size for a time slider control. The value is empty if no time interval is suggested. The author of the layer's data typically configures this property if the data has been collected on a regular basis. For example, the daily position of a hurricane.
This function was introduced in Esri::ArcGISRuntime 100.3.
[override virtual, since Esri::ArcGISRuntime 100.3]
Esri::ArcGISRuntime::TimeValue RasterLayer::timeOffset () const
Reimplements: TimeAware::timeOffset() const.
Returns the amount of time by which the temporal values of this layer's data points are offset when displaying it in a GeoView.
The time offset is subtracted from the time extent set on the layer's GeoView. This is useful if you want to overlay data in multiple layers that lies within different temporal extents. For example, if you want to compare data in one layer for a certain year with data in the same layer from the subsequent year, you can create two layers that reference the same data's service endpoint but set the TimeValue in one of the layers to be one year.
This function was introduced in Esri::ArcGISRuntime 100.3.
See also setTimeOffset().