Class RasterLayer

  • All Implemented Interfaces:
    TimeAware, LayerContent, Loadable

    public final class RasterLayer
    extends ImageAdjustmentLayer
    implements TimeAware
    A RasterLayer is used to render data from a Raster.

    Example for working with a Raster Layer:

     
     Raster raster = new Raster("absolute-file-path-of-raster");
     
     RasterLayer rasterLayer = new RasterLayer(raster);
     
     rasterLayer.addDoneLoadingListener(() -> {
       if (rasterLayer.getLoadStatus() == LoadStatus.LOADED) {
         // raster layer has loaded
       }
     });
     
     ArcGISMap map = new ArcGISMap();
     map.getOperationalLayers().add(rasterLayer);
     
     mapView = new MapView();
     mapView.setMap(map);
     
    The layer is loaded when displayed in a MapView; if using the layer without a MapView, call the Layer.loadAsync() method. Use the layer done loading event to determine when the layer is ready, and check the loaded status before using the layer.

    Since:
    100.0.0
    See Also:
    Raster
    • Constructor Detail

      • RasterLayer

        public RasterLayer​(Raster raster)
        Creates a new RasterLayer with the provided raster.
        Parameters:
        raster - the raster source
        Throws:
        IllegalArgumentException - if raster is null
        Since:
        100.0.0
      • RasterLayer

        public RasterLayer​(PortalItem portalItem)
        Creates a new RasterLayer with the provided portal item.
        Parameters:
        portalItem - the portal item
        Throws:
        IllegalArgumentException - if portalItem is null
        Since:
        100.2.0
    • Method Detail

      • getRaster

        public Raster getRaster()
        Returns the raster used by this raster layer.
        Returns:
        the raster used by this raster layer
        Since:
        100.0.0
      • setRasterRenderer

        public void setRasterRenderer​(RasterRenderer rasterRenderer)
        Sets the raster renderer.
        Parameters:
        rasterRenderer - the rasterRenderer to set
        Throws:
        IllegalArgumentException - if rasterRenderer is null
        Since:
        100.0.0
      • copy

        public RasterLayer copy()
        Creates a deep copy of this RasterLayer instance.
        Returns:
        a deep copy of this RasterLayer instance, which means that copies of all fields of this layer are made including its loading state
        Since:
        100.1.0
      • getRasterRenderer

        public RasterRenderer getRasterRenderer()
        Gets the raster renderer.
        Returns:
        the raster renderer
        Since:
        100.0.0
      • getFullTimeExtent

        public TimeExtent getFullTimeExtent()
        Description copied from interface: TimeAware
        Returns the full time extent of the object. Will be null if the object is not time aware.
        Specified by:
        getFullTimeExtent in interface TimeAware
        Returns:
        the time extent, or null if the object is not time aware
      • getTimeInterval

        public TimeValue getTimeInterval()
        Description copied from interface: TimeAware
        Returns the suggested time slider step size for this time aware object. Can be null if no time interval is suggested for this time aware object.
        Specified by:
        getTimeInterval in interface TimeAware
        Returns:
        the time interval, or null if there is no time interval
      • getTimeOffset

        public TimeValue getTimeOffset()
        Description copied from interface: TimeAware
        Returns the time offset applied to this object. The offset is subtracted from the time extent set on the owning GeoView. This allows for data from different periods of time to be compared.
        Specified by:
        getTimeOffset in interface TimeAware
        Returns:
        the time offset, or null if no offset has been set
      • isTimeFilteringEnabled

        public boolean isTimeFilteringEnabled()
        Description copied from interface: TimeAware
        Returns whether or not the object must use the time extent defined on the owning GeoView to filter its data.
        Specified by:
        isTimeFilteringEnabled in interface TimeAware
        Returns:
        true if time filtering is enabled; otherwise false
      • setIsTimeFilteringEnabled

        public void setIsTimeFilteringEnabled​(boolean enabled)
        Description copied from interface: TimeAware
        Enables or disables whether the object must use the time extent defined on the owning GeoView to filter its data.
        Specified by:
        setIsTimeFilteringEnabled in interface TimeAware
        Parameters:
        enabled - true to enable time filtering; otherwise false
      • isTimeFilteringSupported

        public boolean isTimeFilteringSupported()
        Description copied from interface: TimeAware
        Returns whether or not the object supports filtering its contents by time values with the extent set on the owning GeoView.
        Specified by:
        isTimeFilteringSupported in interface TimeAware
        Returns:
        true if time filtering is supported; otherwise false
      • setTimeOffset

        public void setTimeOffset​(TimeValue timeOffset)
        Description copied from interface: TimeAware
        Sets a time offset for this object. The time offset is subtracted from the time extent set on the owning GeoView. This allows for data from different periods of time to be compared. Can be null if there is no time offset.
        Specified by:
        setTimeOffset in interface TimeAware
        Parameters:
        timeOffset - the time offset, or null if there is no time offset