Class TLspRasterLayerBuilder

java.lang.Object
com.luciad.view.lightspeed.layer.ALspLayerBuilder
com.luciad.view.lightspeed.layer.raster.TLspRasterLayerBuilder

public class TLspRasterLayerBuilder extends ALspLayerBuilder
Builder for creating ILspLayer instances that visualize raster data.

Supported data

The following object types and models are supported:

This means that either the domain objects in the model should match one of the above types or the styler should provide a geometry of one of the supported types.

Styling color and elevation data

By default, color data is visualized using the image's own color model. Elevation data is visualized with a DTED color mapping.
The visualization of the raster data can be configured by setting a styler. The styler can submit the following styles:

  • a TLspRasterStyle instance: mandatory, this controls the visualization of the raster values
  • a TLspImageProcessingStyle instance: an image processing operator chain applied to the raster
  • a TLspLineStyle instance: this controls the style of the outline of the bounds of the raster
  • a TLspFillStyle instance: this controls the style of the fill of the bounds of the raster
The raster values are only painted if the pixel density of the raster is not too high (depending on the TLspRasterStyle.getStartResolutionFactor()). Otherwise the bounds of the raster are painted instead.
If no custom styler is specified, an ILspCustomizableStyler is configured that exposes the TLspRasterStyle and bounds related styles mentioned above.

Styling parameterized image data

Images or parameterized data from Earth tilesets can be visualized using an icon grid. This can be configured by using a TLspParameterizedRasterIconStyle as the styler.

When using one dimensional parameterized data from Earth tile, a default visualization is chosen, depending on the parameter and unit:

  • for angles, an arrow icon grid is used
  • for Kelvin (K), Celsius (C), Percentage (%), and proportion, a specific color mapping is chosen
Two-dimensional Earth tileset data is either visualized using a wind icon grid or an arrow icon grid. The builder supports several data types, such as wind, currents and waves. Further customization is possible by setting a TLspParameterizedRasterIconStyle.

Icon grid layers internally use the LABEL paint representation. The label representation is used because this ensures the icons are always visible and never clipped by terrain in a 3D view. Thus, when configuring a layer with a TLspParameterizedRasterIconStyle, you should use the label paint representation, not the body paint representation. Additionally, if you need to interact with an icon grid layer after it has been created, you will have to refer to the label paint representation.

Interactive layers

The behavior of the raster layer may also be influenced by the layer type that is set:

It is recommended to keep background layers at the bottom of the view as this allows the view to optimized memory usage and performance by combining multiple background layers.

Limitations

The most important limitations are:
  • When changing a raster layer, may temporarily not paint anything in the view until the change has been processed in the following situations:
  • You can track the layer's status to know when it is processing changes.
  • Style target providers are not supported for layers of type background.
Since:
2012.0
  • Method Details

    • newBuilder

      public static TLspRasterLayerBuilder newBuilder()
      Returns:
      a new raster layer builder with the default settings
    • styler

      public TLspRasterLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler)
      Sets the styler of the raster.

      Only the TLspPaintRepresentation#BODY affects the style of the raster. There is one exception: when using a TLspParameterizedRasterIconStyle, the LABEL paint representation should be used.

      Refer to the class javadoc for an overview of the supported styles.

      The default styler drapes the raster data on top of the view's terrain and paints a red hatched rectangle when zoom out too far. For a raster with color data you can reproduce its behavior with the following styler:

       new TLspStyler(
         TLspLineStyle.newBuilder().color(Color.RED).build(),
         TLspFillStyle.newBuilder().color(Color.RED).stipplePattern(TLspFillStyle.StipplePattern.HATCHED).build(),
         TLspRasterStyle.newBuilder().build()
       );
       
      Note that some additional configuration is needed for non-color data (ex. elevation data). See TLspRasterStyle.Builder for details.
      Parameters:
      aPaintRepresentationState - the paint representation.
      aStyler - the styler
      Returns:
      this builder
    • build

      public ILspEditableStyledLayer build()
      Description copied from class: ALspLayerBuilder

      Creates a new layer instance.

      Specified by:
      build in class ALspLayerBuilder
      Returns:
      the new layer instance
    • model

      public TLspRasterLayerBuilder model(ILcdModel aModel)
      Sets the model.

      The following object types and models are supported:

      This means that either the domain objects in the model should match one of the above types or the styler should provide a geometry of one of the supported types.
      Overrides:
      model in class ALspLayerBuilder
      Parameters:
      aModel - a raster model
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if aModel is not a supported raster model
      See Also:
    • label

      public TLspRasterLayerBuilder label(String aLabel)
      Description copied from class: ALspLayerBuilder
      Sets the label of the layer. This is a short textual representation for it, often used to represent the layer to end-users.

      The default value is null.

      Overrides:
      label in class ALspLayerBuilder
      Parameters:
      aLabel - the label
      Returns:
      this builder
      See Also:
    • layerType

      public TLspRasterLayerBuilder layerType(ILspLayer.LayerType aLayerType)
      Sets the layer type.

      The layer type should be one of the following:

      It is recommended to keep background layers at the bottom of the view as this allows the view to optimized memory usage and performance by combining multiple background layers.

      The default layer type is ILspLayer.LayerType.BACKGROUND for models with an ILcdEarthTileSet and ILspLayer.LayerType.INTERACTIVE otherwise.

      Overrides:
      layerType in class ALspLayerBuilder
      Parameters:
      aLayerType - the new layer type
      Returns:
      this builder
      See Also:
    • icon

      public TLspRasterLayerBuilder icon(ILcdIcon aIcon)
      Description copied from class: ALspLayerBuilder
      Sets the icon of the layer.

      The default value is null.

      Overrides:
      icon in class ALspLayerBuilder
      Parameters:
      aIcon - the icon
      Returns:
      this builder
      See Also:
    • layerStyle

      public TLspRasterLayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
      Description copied from class: ALspLayerBuilder
      Set a layer style to be used during the rendering of the layer. TLspLayerStyle is used to style the layer as a whole. Layer style can for example modify the transparency of a layer. Also, layer style can be modified after building the layer by calling ILspLayer.setLayerStyle(TLspLayerStyle).
      Overrides:
      layerStyle in class ALspLayerBuilder
      Parameters:
      aLayerStyle - the layer style. Must not be null. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
      Returns:
      this
      See Also:
    • filter

      public TLspRasterLayerBuilder filter(ILcdDynamicFilter aFilter)
      Sets a filter that will be used to filter objects to prevent them from being painted by the layer. No filter is set by default.
      Parameters:
      aFilter - the filter
      Returns:
      this
    • borderFactor

      public TLspRasterLayerBuilder borderFactor(double aBorderFactor)
      Sets the size of the surplus border that is processed, relative to the view.

      A high value increases the memory usage and cpu usage, but will often give faster updates for small pan and zoom operations.

      The default value is 0.25 which results in 25% extra data on all sides, so the total processed area is 2.25x the area when using no surplus border.

      Parameters:
      aBorderFactor - the relative amount by which the view is enlarged on each side
      Returns:
      this
    • borderFactor

      public TLspRasterLayerBuilder borderFactor(double aBorderFactor, boolean aIncludeTextureLoading)
      Sets the size of the surplus border that is processed, relative to the view, along with whether texture data loading should be included in this surplus processing.

      A high border factor increases the memory and cpu usage, but will often give faster updates for small pan and zoom operations.

      The default border factor is 0.25 which results in 25% extra data on all sides, so the total processed area is 2.25x the area when using no surplus border.

      By default, texture loading is not included in the surplus processing. Including it increases the memory and cpu usage even more, but will often give faster updates for small pan and zoom operations.

      Parameters:
      aBorderFactor - the relative amount by which the view is enlarged on each side
      aIncludeTextureLoading - indicates whether texture data loading should be included in the surplus processing.
      Returns:
      this
      Since:
      2018.2
    • incrementalPainting

      public TLspRasterLayerBuilder incrementalPainting(boolean aIncrementalPainting)
      Sets whether the layer is repainted as soon as a tile becomes available. When set to false, the layer is not updated until all tiles are ready.

      By default, this property is set to true.

      Parameters:
      aIncrementalPainting - boolean indicating whether the layer is repainted as soon as a tile becomes available.
      Returns:
      this
      Since:
      2018.1
    • sldStyle

      public TLspRasterLayerBuilder sldStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle)

      Use the styling defined in aFeatureTypeStyle to style the layer under creation. All relevant settings on the layer will be adjusted to match the info contained in the SLD style.

      Calling this method will is the equivalent of calling (in pseudo-code):

      
         TLspSLDStyler styler = new TLspSLDStyler(aFeatureTypeStyle);
      
         builder.styler(TLspPaintRepresentationState.REGULAR_BODY, styler);
       

      Note that in future versions of the product it is possible that this method will overwrite more settings.

      Parameters:
      aFeatureTypeStyle - The feature type style
      Returns:
      this builder
      Since:
      2017.0
    • mapScaleRange

      public TLspRasterLayerBuilder mapScaleRange(TLcdDimensionInterval<TLcdMapScale> aScaleRange)
      Sets the scale range of the layer in unitless map scale ratios. This property defines a range of scales in which the layer is visible. By default, no scale range is used, meaning that the layer is always visible.
      Parameters:
      aScaleRange - the scale range for the layer
      Returns:
      this
      Since:
      2021.1
      See Also: