Class RasterLayer.Builder

java.lang.Object
com.luciad.layers.rasters.RasterLayer.Builder
All Implemented Interfaces:
AutoCloseable
Enclosing class:
RasterLayer

public static final class RasterLayer.Builder extends Object implements AutoCloseable
Builder for creating a RasterLayer for a IRasterModel.

Styling color data
By default, color data is visualized using the image's own color model.

The raster values are only painted if the pixel density of the raster is not too high. Otherwise the bounds of the raster is painted instead. The style for painting the bounds of the raster data can be customized. You can find an example within this related article on basic raster styling.

  • Constructor Details Link icon

  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • build Link icon

      Returns a new layer, based on the properties set on this builder.
      Returns:
      a new layer, based on the properties set on this builder.
      Throws:
      IllegalArgumentException - when the raster tile set structure is not supported.
      IllegalStateException - If not all mandatory parameters are set.
    • title Link icon

      @NotNull public RasterLayer.Builder title(@NotNull String title)
      Sets the title to use for the layer.

      If not set, the title from the ModelMetadata is used.

      Parameters:
      title - the title for the layer.
      Returns:
      this builder.
    • visible Link icon

      @NotNull public RasterLayer.Builder visible(boolean visible)
      Sets whether the layer should be visible initially.

      Default is true.

      Parameters:
      visible - the visibility.
      Returns:
      this builder.
    • model Link icon

      @NotNull public RasterLayer.Builder model(@NotNull IRasterModel model) throws NullPointerException
      Sets the raster model of the layer.

      Calling this function is mandatory.

      Parameters:
      model - the raster model of the layer.
      Returns:
      this builder.
      Throws:
      NullPointerException - if model is null.
    • fillStyle Link icon

      @NotNull public RasterLayer.Builder fillStyle(@NotNull FillStyle fillStyle)
      Sets the fill style used when the raster data extent is shown when zoomed out far.
      Parameters:
      fillStyle - a fill style created with FillStyle#newBuilder.
      Returns:
      this builder.
    • lineStyle Link icon

      @NotNull public RasterLayer.Builder lineStyle(@NotNull LineStyle lineStyle)
      Sets the line style used when the raster data extent is shown when zoomed out far.

      Only one line style can be set, if this function is called when a ComplexStrokeLineStyle has already been set, it will be overwritten.

      Parameters:
      lineStyle - a line style created with LineStyle#newBuilder.
      Returns:
      this builder.
    • lineStyle Link icon

      @NotNull public RasterLayer.Builder lineStyle(@NotNull ComplexStrokeLineStyle lineStyle)
      Sets the line style used when the raster data extent is shown when zoomed out far.

      Only one line style can be set, if this function is called when a LineStyle has already been set, it will be overwritten.

      Parameters:
      lineStyle - a complex stroke line style created with ComplexStrokeLineStyle#newBuilder.
      Returns:
      this builder.
      Since:
      2023.1
    • rasterStyle Link icon

      @NotNull public RasterLayer.Builder rasterStyle(@NotNull RasterStyle rasterStyle)
      Sets the style for this raster.
      Parameters:
      rasterStyle - the raster style to apply.
      Returns:
      this builder.
      Since:
      2023.1
    • layerType Link icon

      @NotNull public RasterLayer.Builder layerType(@NotNull RasterLayerType layerType)
      Sets this raster layer type.

      This parameter is optional. If not set, the default is RasterLayerType#Background. Note that setting the layer type has no effect on elevation raster layers.

      Parameters:
      layerType - the type of this raster layer.
      Returns:
      this builder.
      Since:
      2024.0
      See Also:
    • detailFactor Link icon

      @NotNull public RasterLayer.Builder detailFactor(double factor) throws IllegalArgumentException
      Sets the detail factor to use.

      The detail factor modifies the quality/detail of the loaded data.

      Parameters:
      factor - The factor to apply.
      A factor 1 means no change (default value).
      A factor > 1 means more detail.
      A factor < 1 means less detail.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - if the factor is not strictly positive.